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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UTF-8 importing in VFP 8 1

Status
Not open for further replies.

grahamrhind

Technical User
Jul 8, 2003
99
A1
Hi,
I have some encoded text files (Unicode UTF-8) files which I want to import into a VFP data table. I am currently using VFP 6, and, as far as I can tell (please correct me
if I am wrong) I cannot encode a data table in this version to correctly read the accents in the UTF-8 data.

I understand that VFP 8 is also not good at handling Unicode data - is that correct? Can a VFP 8 data table correctly import and show UTF-8 data? It probably can't be done with APPEND FROM, and the only hint I have had is that there is a STRCONV() command that can help - but can this be used to import from a text file? Any input on this would be greatly appreciated!

Thanks in advance
 
I'm not sure if it would work because I don't have a UTF file to test, but you could read the file as one big character, convert to double-byte, write it back out, then append it. Something like

lcMyFile = STRCONV(FILETOSTR("MyFile.Txt"), 11)
* 11 converts from UTF to Double byte
STRTOFILE(lcMyFile, "MyNewFile.Txt")
APPEND FROM MyNewFile.Txt


Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
grahamrhind,

Sorry I can't help with your UTF-8 question, but I can tell you that VFP provides very poor support for Unicode. You can store Unicode characters in a table, but you cannot view or edit it using the native VFP controls.

Mike


Mike Lewis
Edinburgh, Scotland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top