Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

write file with UTF-8 encoding

Status
Not open for further replies.

imox

Programmer
May 13, 2013
37
DE
Hello,

I write my txt files with FCREATE, FWRITE .... how can I write the file with UTF-8 encoding?

Thanks
 
The essential function to use on ANSI text is STRCONV(string,9).

That is the nConversionsetting from DBCS to UTF-8, where DBCS stands for double byte character set, which many don't recognize as the correct source setting for the VFP ANSI encoded strings, but that works for the full set of eg ANSI 1252 code page.

So instead of FWRITE(handle, string) you do FWRITE(handle, STRCONV(string,9)).

Bye, Olaf.

 
Thanks for your description. I've done this like you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top