[xml] UTF-8 xml file displays character reference



Hi,

 

I have a behavior I am not sure to be correct using XmlTextWriter…

I create an XML file with encoding UTF-8. In this file some strings may contents some ISO Latin 1 character such as ‘É’ ‘°’ and so on…

In order to prevent an error with a non UTF-8 character when validating the XML file I detect strings that hold non UTF-8 char (using xmlCheckUTF8) and convert them using isolat1ToUTF8. As a result I have the character reference É for ‘É’ in XML. C9 is the hexadecimal, so this is correct but I would expected the UTF-8 character ‘É’ instead not it’s hexadecimal representation…

 

Maybe am I doing something wrong: I create my document this with

xmlTextWriterStartDocument(writer, NULL, "UTF-8", NULL);

and use xmlTextWriterWriteAttribute(writer, … to write data…

 

Thanks for any hints,

 

Stephane Michaut

 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]