DBFs with rare characters / DBFs con caracteres raros

HMG en Español

Moderator: Rathinagiri

Post Reply
User avatar
andyglezl
Posts: 1191
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 37 times
Been thanked: 85 times
Contact:

DBFs with rare characters / DBFs con caracteres raros

Post by andyglezl » Tue Dec 03, 2019 6:22 am

Hola

Recuerdo que hubo un post en el que se trato sobre convertir los datos de un DBF
de ANSI a UNICODE, pero no lo encuentro. Alguien se acuerda como localizarlo ?
*----------------------------------------------------------------------------------------------------------
Hi

I remember that there was a post that dealt with converting data from a DBF
from ANSI to UNICODE, but I can't find it. Anyone remember how to locate it?
Andrés González López
Desde Guadalajara, Jalisco. México.

User avatar
mustafa
Posts: 862
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Been thanked: 132 times
Contact:

Post by mustafa » Tue Dec 03, 2019 12:07 pm

Hola Andres
Mira si puede servir aportaciones de Esgici y de Serge

viewtopic.php?f=10&t=3416&p=31491&hilit=unicode#p31491

Saludos
Mustafa

User avatar
andyglezl
Posts: 1191
Joined: Fri Oct 26, 2012 7:58 pm
Location: Guadalajara Jalisco, MX
Has thanked: 37 times
Been thanked: 85 times
Contact:

Post by andyglezl » Tue Dec 03, 2019 1:49 pm

Muchas gracias Mustafa, las probare.

Por lo pronto, ignore los caracteres a leer los campos de la BD.

Code: Select all

	FOR i1 = 0 TO 31
		ChildForm := STRTRAN( ChildForm, CHR( i1 ), '' )
	NEXT
	FOR i1 = 32 TO 47
		ChildForm := STRTRAN( ChildForm, CHR( i1 ), '' )
	NEXT
	FOR i1 = 58 TO 64
		ChildForm := STRTRAN( ChildForm, CHR( i1 ), '' )
	NEXT
	FOR i1 = 91 TO 96
		ChildForm := STRTRAN( ChildForm, CHR( i1 ), '' )
	NEXT
	FOR i1 = 123 TO 255
		ChildForm := STRTRAN( ChildForm, CHR( i1 ), '' )
	NEXT

Pues fue más fácil de lo que creí...
*--------------------------------------------
Well, it was easier than I thought ...


ACLARACIÖN:
El siguiente código en realidad no convierte UNICODE, lo que está haciendo
(no se la razón todavía) es que cada caracter "raro" lo convierte en un "Espacio"
y al final yo elimino los espacios para que no me de error al crear una ventana,
que es lo que yo quería en este momento.
*-----------------------------------------------------------------------------------------------------
CLARIFICATION:
The following code does not actually convert UNICODE, what you are doing
(I don't know the reason yet) is that every "weird" character makes it a "Space"
and in the end I delete the spaces so that I don't get an error when creating a window,
That is what I wanted at this moment.

Code: Select all

	FOR i1 = 1 TO HMG_LEN( ChildForm )
		ChildForm := STRTRAN( ChildForm, CHR( i1 ), HB_UCODE( CHR( i1 ) ) )
	NEXT
	ChildForm := STRTRAN( ChildForm, " ", '' )

Gracias de nuevo Mustafa !
Andrés González López
Desde Guadalajara, Jalisco. México.

Post Reply