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!

XML re-encoding... 1

Status
Not open for further replies.

Neil Toulouse

Programmer
Mar 18, 2002
882
GB
Hi

We have an issue where one of our customers is generating an XML file with the incorrect encoding (ANSI not UTF-8).

Is there a quick and dirty method (in VFP - I know this can be done in Notepad but needs to be in VFP) to re-encode this XML file or do I need to reconstruct it with the correct encoding?

TIA
Neil

I like work. It fascinates me. I can sit and look at it for hours...
 
Look up the StrConv() function. Strconv(ansistring,9) does convert to UTF-8. I'd also ask the customer to correct his encoding.

Also look into the first bytes of the xml file. Maybe your customer simply used notepad to make some manual changes and didn't care to choose the correct encoding. And even if they choose UTF-8 in notepad, the first few bytes will then be a BOM (byte order mark) and will not comply to XML parsing, they need to be removed.

Bye, Olaf.


 
Cheers Olaf, I will give it a go!



I like work. It fascinates me. I can sit and look at it for hours...
 
Thanks Olaf, STRCONV() does the job :)

I like work. It fascinates me. I can sit and look at it for hours...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top