[xsd-users] xml_schema::Date and xml_schema::Time are wrong serialized on UNICODE files

Boris Kolpackov boris at codesynthesis.com
Mon Nov 22 08:33:41 EST 2010


Hi Constantin,

Constantin Iacobescu <sir.costy at gmail.com> writes:

> If you look in the xml file I have sent to you and look at it in a hex
> editor you will see that if you are converting that strange values from
> hex to dec you will get the good value of them

I have an idea about what might be going on. Some of the values in
the xml_schema::date type are of the unsigned short type. If wchar_t
is defined as a typedef, then it will most likely be to this type as
well. As a result, when you insert unsigned short to std::wostream,
it is treated as a character rather than as an integer value.

Can you make sure that in your project's properties "C/C++" / "Language"
tab the "Treat wchar_t as Built-in Type" property is set to "Yes"?

If this doesn't help, then I will still need the minimal test case
that reproduces this problem. Right now all I do is guess what might
be the problem.

Boris



More information about the xsd-users mailing list