From: Fabian J. <fab...@gm...> - 2007-06-20 08:16:22
|
Hi, I have a problem with utf-8. I'm using personal compilation of GLibmm 2.12.10 Here is my code: xmlpp::Document* d; > > d =3D new xmlpp::Document(); > xmlpp::Element* n; > > n =3D d->create_root_node("root","",""); > > n->add_child("child1",""); > n->add_child("child2",""); > n->add_child("child3",""); > n->add_child("child4",""); > > n->set_attribute("att1","valeur avec =E9 etc",""); > n->set_attribute("att2","valeur avec =EA etc",""); > n->set_attribute("att3","valeur avec etc",""); > > d->write_to_file_formatted("c:\\test.xml","UTF-8"); > Remarks about output file: - No UTF-8 header "0xEF BB BF" - "=E9 etc" is coded like this "0xE9 A0 A5 74 63". I think 0x20 is missing for the space, I'm not sure "=E9" is correctly coded, "e" from "= etc" is missing - "=EA etc" is coded like this "0xEA A0 A5 74 63". Same remarks - " etc" is coded like this "0x20 20 65 74 63" I tried to open the xml with explorer and I have bad characters in place of "=E9" and "=EA". Did I do any error in my code? |