Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UTF-8 and special chars
Message
General information
Forum:
Visual FoxPro
Category:
XML, XSD
Miscellaneous
Thread ID:
00818673
Message ID:
00818746
Views:
15
It sounds like the file is UTF-8 encoded on disk which is as it should be.

How are you loading hte document into the DOM? If you're loading the text as a file all should work fine, but if you first load the file to a string, then use LoadXML() you're telling the XML parser to treat the data as literal text rather than UTF-8 encoded which means it tries to double encode the already UTF-8 encoded data.

IOW, it means this: If you load a string into the DOM it should NOT be UTF-8 encoded (ie contain the actual extended characters). When you load from file it must be UTF-8 encoded.

Confusing, huh? But unfortunately that's how it works...

+++ Rick ---


>Hi there,
>
>I have a xml-file which I want to read and write to a delimited file.
>The xml-file contains special german chars, which are diplayed properly
>when I open the file with Internet-Explorer 6.
>But when I use the MSXML.DLL, Version 4 things don't work like I want.
>For example, the german char "ö" (chr(246)), becomes chr(111) + chr(168) ("o" and the two little dots above the "o" as a second char).
>The xml-file, which is UTF-8 encoded, viewed with a hex-editor, contains this
>char as char(111) + char(204) + chr(136).
>
>I also tried to convert the fields containing these special chars with strconv, but whatever I try does not work.
>
>The code I use to get fields from the xml-file is something like:
>
>cString = oObject.getelementsnytagname("b037").item(0).text
>
>Could anyone give me some advice what to do ?
>
>Thanks in advance
>
>Thomas
>
>P.S.: I use VFP7, SP1
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform