Welcome! Log In Create A New Profile

Advanced

Problem reading XML-data (ä,ê etc)

Posted by Frans 
Frans
Problem reading XML-data (ä,ê etc)
March 08, 2009 10:53PM
Hello to you al,

I read data from an XMl document but I have problems in reading the ë,â etc.
For instance: In the XML document there is
<Country>België</Country>
I know this because I opened the XML-document.

When I do a Trace( XMLData("xmldoc") ) the answer is: België
It changes Hülcke into something like HÃ&frac14;lcke.

I looked in the help at XMLData but there is nothing about transforming accents?
I think it has something to do with the character set used but I don't know how to solve it.
What happened and how can I get the right answer.

Regards and thanks in advance,

Frans



Edited 1 time(s). Last edit at 03/08/2009 11:44PM by Frans.
Frans
Re: Problem reading XML-data (ä,ê etc)
March 09, 2009 12:16AM
Hello to you al,


I think I solved it.
I used UTF8ToString(XMLData("xmldoc") ")

It works but I don't know if it can produce other problems because I think it is a sort of translation table. So it is possible that it now produces wrong answers for other combinations of characters.
Anybody any idea?

Regards and thanks in advance.

Frans
Peter Holemans
Re: Problem reading XML-data (ä,ê etc)
March 09, 2009 10:43AM
Hi,

Please bear in mind that XML is not necessarily encoded as UTF8... It could be UTF16, ANSI or otehr ISO encodings. The encoding describes the byte-order and character map of the content, not the content itself.

What you want to do is encode reserved (ampersand, slash, greater than, smaller than, ...) or other special characters... The commands to use for making the text content XML compliant are:
TextToXML() and XMLToText()

Cheers,

Peter
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: