Hello,
I need to create a TXT file as UTF-8.
Now I create standard ANSI, Edit the file in my editor and SAVE it as UTF-8.
Can I do this from within my PRG?
Thanks, Serge
TXT file create
Moderator: Rathinagiri
- serge_girard
- Posts: 3420
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
TXT file create
There's nothing you can do that can't be done...
Re: TXT file create
Hallo, probeer het eens op deze manier.
Code: Select all
set( _SET_CODEPAGE, "PLWIN" )
cANSI := "Zażółć gęślą jaźń" /* <- String Windows-1250 Encoded */
HB_MemoWrit( "Text file UTF-8 Encoded.txt", UTF8_BOM + hb_StrToUTF8( cANSI, "PLWIN") ) /* file UTF-8 Encoded with Byte Order Mark */
HB_MemoWrit( "Another Text file UTF-8 Encoded.txt", hb_StrToUTF8( cANSI, "PLWIN") ) /* file UTF-8 Encoded without Byte Order Mark */
- serge_girard
- Posts: 3420
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: TXT file create
Thanks Edward,
I will take a look at it shortly !
My data comes from SQL database and contains French, Spanish and German languages (for the time being) and is put into a TXT file by my program.
The file with the UTF8_BOM is indeed saved as UTF8 but content is messed up: Fran�ois instead of François.
I need to same this was hardcoded in my program and the PRG is save as ANSI.
I will try with real data this week.
Thanks again!
Serge
I will take a look at it shortly !
My data comes from SQL database and contains French, Spanish and German languages (for the time being) and is put into a TXT file by my program.
The file with the UTF8_BOM is indeed saved as UTF8 but content is messed up: Fran�ois instead of François.
I need to same this was hardcoded in my program and the PRG is save as ANSI.
I will try with real data this week.
Thanks again!
Serge
There's nothing you can do that can't be done...