HB_SetCodePage( "PT850" )

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
susviela
Posts: 9
Joined: Wed Oct 17, 2018 4:44 am
DBs Used: DBF, PostgreSql, SQLite
Has thanked: 4 times
Contact:

HB_SetCodePage( "PT850" )

Post by susviela » Wed Nov 28, 2018 4:57 pm

Where is the error?

------------------------------
Desculpe el español :

Me apresenta caracteres con error ( HMG 3.4.4 / Unicode ) con el seguinte codigo.

Code: Select all

	REQUEST HB_LANG_PT
	REQUEST HB_CODEPAGE_PT850     
	
	HB_SetCodePage( "PT850" )                 
	HB_LANGSELECT("PT") 
   
W64-HMG-MariaDB.png
Error
W64-HMG-MariaDB.png (4.26 KiB) Viewed 150 times

User avatar
mustafa
Posts: 719
Joined: Fri Mar 20, 2009 11:38 am
Location: Alicante - Spain
Been thanked: 88 times

Post by mustafa » Wed Nov 28, 2018 5:37 pm

Hola amigo susviela
Prueba , haber si funciona
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850

HB_SetCodePage( "PT850" )
HB_LANGSELECT("PT")

Añade
SET CODEPAGE TO UNICODE

salva el Prg como "UTF-8"
Saludos
Mustafa
*-----------------------------------------------------------------*
Olá meu amigo
Teste, se funcionar
REQUEST HB_LANG_PT
REQUEST HB_CODEPAGE_PT850

HB_SetCodePage( "PT850" )
HB_LANGSELECT("PT")

Adicionar
      SET CODEPAGE TO UNICODE

Salve o Prg como "UTF-8"
Saudações
Mustafa

User avatar
susviela
Posts: 9
Joined: Wed Oct 17, 2018 4:44 am
DBs Used: DBF, PostgreSql, SQLite
Has thanked: 4 times
Contact:

Post by susviela » Wed Nov 28, 2018 6:00 pm

Gracias por contestar y esto funciona pero em

SET CODEPAGE TO UNICODE

me produz error em una rutina de criptografia donde uso ASC() / CHR()

me clarea una cosa ahora .. voi a probar colocar los calculos entre :

HB_SetCodePage( "PT850" )
..
..
..
SET CODEPAGE TO UNICODE

User avatar
mustafa
Posts: 719
Joined: Fri Mar 20, 2009 11:38 am
Location: Alicante - Spain
Been thanked: 88 times

Post by mustafa » Wed Nov 28, 2018 7:51 pm

Mira
http://www.hmgforum.com/viewtopic.php?f ... 6&start=10
el programa CFANS2UT8.rar de serge_girard
te hará la conversión
vai fazer você a conversão
Saludos
Mustafa

User avatar
susviela
Posts: 9
Joined: Wed Oct 17, 2018 4:44 am
DBs Used: DBF, PostgreSql, SQLite
Has thanked: 4 times
Contact:

Post by susviela » Wed Nov 28, 2018 9:12 pm

Eita que esse troço de UNICODE / UTF8 é complicado mas .. ta resolvido ...

Una dica el CODEPAGE default do HMG 3.4.4 é UTF8.

entonces: SET CODEPAGE TO UNICODE / hb_cdpSelect( "UTF8" ) - no es necessario, a menos que usted pretenda cambiar esto.

Testar con: msginfo( HB_SetCodePage() )

------------------------

Unas pesquisas y encontre estas funcion:

hb_UTF8ToStr()
hb_StrToUTF8()

- HB_UCODE ( cUnicodeCharacter ) --> Return nCode / ASC
- HB_UCHAR ( nCode ) --> Return cUnicodeCharacter / CHR


hb_StrToUtf8( sData, sCodepageIN ) Translation sData of sCodepageIN in utf8
hb_Utf8ToStr( sData, sCodepageOUT ) Translation sData from utf8 to sCodepageOUT

hb_Utf8Len( sData ) This and the following functions are analogs of
hb_utf8Chr( n ) the standard string functions Len(),
hb_utf8Asc( sData ) Chr(), Asc (), etc., but for rows in a
hb_utf8Substr( sData, n1, n2 ) utf8 encoding. As it is known, in utf8
hb_utf8Left( sData, n1 ) one character may be encoded with more
hb_utf8Right( sData, n1 ) than one byte. These functions operate with
hb_utf8Stuff( sData, n1, n2, cNew ) the number of symbols rather than bytes.
hb_utf8Peek( sData, n1 )
hb_utf8Poke( sData, n1, n )

Post Reply