procedure main()
local cStr := hb_utf8tostr( hb_memoread( 'utf8.txt' ) )
setmode(40,80);setcolor('w+/n');cls
? 'Directly : ', cStr
? 'UTF8toSTR : ',hb_utf8tostr( cStr )
? 'OEMtoANSI + UTF8toSTR: ',hb_oemtoansi( hb_utf8tostr( cStr ) )
? 'ANSItoOEM + UTF8toSTR: ',hb_ansitooem( hb_utf8tostr( cStr ) )
? 'UTF8toSTR + OEMtoANSI: ',hb_utf8tostr( hb_oemtoansi( cStr ) )
? 'UTF8toSTR + ANSItoOEM: ',hb_utf8tostr( hb_ansitooem( cStr ) )
? 'OEMtoANSI : ',hb_oemtoansi( cStr )
? 'ANSItoOEM : ',hb_ansitooem( cStr )
?
cStr := hb_utf8tostr( memoread( 'utf8.txt' ) )
? 'Directly : ', cStr
? 'UTF8toSTR : ',hb_utf8tostr( cStr )
? 'OEMtoANSI + UTF8toSTR: ',hb_oemtoansi( hb_utf8tostr( cStr ) )
? 'ANSItoOEM + UTF8toSTR: ',hb_ansitooem( hb_utf8tostr( cStr ) )
? 'UTF8toSTR + OEMtoANSI: ',hb_utf8tostr( hb_oemtoansi( cStr ) )
? 'UTF8toSTR + ANSItoOEM: ',hb_utf8tostr( hb_ansitooem( cStr ) )
? 'OEMtoANSI : ',hb_oemtoansi( cStr )
? 'ANSItoOEM : ',hb_ansitooem( cStr )
?
cStr := hb_memoread( 'utf8.txt' )
? 'Directly : ', cStr
? 'UTF8toSTR : ',hb_utf8tostr( cStr )
? 'OEMtoANSI + UTF8toSTR: ',hb_oemtoansi( hb_utf8tostr( cStr ) )
? 'ANSItoOEM + UTF8toSTR: ',hb_ansitooem( hb_utf8tostr( cStr ) )
? 'UTF8toSTR + OEMtoANSI: ',hb_utf8tostr( hb_oemtoansi( cStr ) )
? 'UTF8toSTR + ANSItoOEM: ',hb_utf8tostr( hb_ansitooem( cStr ) )
? 'OEMtoANSI : ',hb_oemtoansi( cStr )
? 'ANSItoOEM : ',hb_ansitooem( cStr )
?
cStr := memoread( 'utf8.txt' )
? 'Directly : ', cStr
? 'UTF8toSTR : ',hb_utf8tostr( cStr )
? 'OEMtoANSI + UTF8toSTR: ',hb_oemtoansi( hb_utf8tostr( cStr ) )
? 'ANSItoOEM + UTF8toSTR: ',hb_ansitooem( hb_utf8tostr( cStr ) )
? 'UTF8toSTR + OEMtoANSI: ',hb_utf8tostr( hb_oemtoansi( cStr ) )
? 'UTF8toSTR + ANSItoOEM: ',hb_utf8tostr( hb_ansitooem( cStr ) )
? 'OEMtoANSI : ',hb_oemtoansi( cStr )
? 'ANSItoOEM : ',hb_ansitooem( cStr )
?
wait
return
**utf.txt
(aeiou) x (áúíóãõ) x (áéíú)
2010/11/1 Qatan <wanst...@gmail.com>:
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: http://groups.google.com/group/harbour-users
>
--
Massimo Belgrano
Iscritto all'albo dei CTU presso il Tribunale di Novara per materia Informatica
Delta Informatica S.r.l. (http://www.deltain.it/) (+39 0321 455962)
Analisi e sviluppo software per Lan e Web - Consulenza informatica - Formazione
>Thanks for your sample
>what is strange for you?
The result on SCREEN is DIFFERENT from what you see on the TXT file.
The TXT was created and saved using Windows Notepad in UTF8 format.
Thanks for your help.
Qatan
PS: See the screen: http://www.tribaltradingcompany.com.br/qatan/Image.jpg
The best result I found was:
[CODE]
procedure main()
local cStr := ( hb_memoread( 'utf8.txt' ) )
setmode(25,80);setcolor('w+/n');cls
? 'Directly : ',cStr
? 'UTF8toSTR OEM : ',hb_utf8tostr( cStr )
? 'UTF8toSTR ANSI: ',hb_oemtoansi( hb_utf8tostr( cStr ) )
?
wait
return
[/CODE]
But special chars "�" and "� "do not show correct in this test
Do you know why? What am I missing here?
Thanks for any help.
Qatan
http://harbourlanguage.blogspot.com/search/label/codepage
--