[xsd-users] Serialization and accent

Julien KHONG julienkhong at yahoo.fr
Thu Feb 25 10:20:34 EST 2010


Hi all

When i try to serialize the value "système" to a file, i get an exception

CharsetTest ct("système");
std::ostringstream oss;
CharsetTest_ (oss, ct, ::xml_schema::NamespaceInfomap (), "UTF-8", xml_schema::Flags::dont_validate); // exception raised here

all is ok when i load a file with the value
std::auto_ptr<CharsetTest> pCharset (CharsetTest_("CharsetTest.xml", ::xml_schema::Flags::dont_validate));

here is the xsd
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="CharsetTest">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="Description" type="xs:string" minOccurs="1" maxOccurs="1" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

and options to generate cpp files
cxx-tree --generate-serialization --generate-polymorphic --type-naming ucc --namespace-map =DataFiles --hxx-suffix .h --cxx-suffix .cpp




      


More information about the xsd-users mailing list