Anyway, thank you very much for willing to investigate. Really appreciate itYou are right, my conversion method not convenient to your needs
Erik
Moderator: Rathinagiri
Anyway, thank you very much for willing to investigate. Really appreciate itYou are right, my conversion method not convenient to your needs
Code: Select all
/*
Convert Unicode 32 string to ANSI
*/
#include <hmg.ch>
PROCEDURE Main
cANSI := Uni322ANSI( MEMOREAD( "Chanson_EAC.txt" ) )
MemoWrit( "ChansonANSI.txt", cANSI )
RETURN
FUNCTION Uni322ANSI( cUni32Str ) // Convert Unicode 32 string to ANSI
RETURN ( SUBSTR( STRTRAN( cUni32Str, CHR(0), '' ), 3 ) )
Code: Select all
/*
Convert Unicode 16 string to ANSI
*/
#include <hmg.ch>
PROCEDURE Main
cANSI := Uni162ANSI( MEMOREAD( "Chanson_EAC.txt" ) )
MsgBox( HMG_ANSI_TO_UNICODE ( cANSI ) )
* MemoWrit( "ChansonANSI.txt", cANSI )
RETURN
FUNCTION Uni162ANSI( cUni16Str ) // Convert Unicode 16 string to ANSI
RETURN ( SUBSTR( STRTRAN( cUni16Str, CHR(0), '' ), 3 ) )
I'm glad that you like itClip2Mania wrote:Perfect! Unmistakenly the shortest working conversion in this post!
And I learned a lot of new functions which I didn't even knew they were part of Harbour
Hi KanaKana wrote:I have code where I write XML file from DBF with
nHandle := FCreate( xmlfile, 0 ) )
...
FWRITE
...
FClose(
This function save ANSI XML file
I don't want convert file with notepad.exe or notepad++ from ANSI to UTF8
Is it posible to save UTF8 file from code?
esgici wrote:
Hi Kana
Last version of an ANSI to UT8 file conversion utility is here.
I haven't any experience on .xml file, so I'm not sure this is convenient for your needs.
Please try and inform us about result.
Happy HMG'ing