[xsd-users] serialize problems: thousands separator in
gyear_month and unsigned long
Boris Kolpackov
boris at codesynthesis.com
Wed Feb 25 10:53:51 EST 2015
Hi Peter,
Sibinger Peter <Peter.Sibinger at cpg.de> writes:
> E.g. in date-time.txx the values x.year=2014 and x.month=12 resulted
> in a stream "2.014-12".
>
> The only solution I found was to add the classic "C" locale to get
> no thousands separator.
I think something in your application changes the global locale
(std::locale::global(); "C" by default). I believe this is a bad
idea and will lead to all kinds of breakages.
I also don't think explicitly setting "C" locale on each stream
that XSD ever creates is a good solution. It will be a performance
drag and is unnecessary in 99.9% (in the 10 years that XSD was
around you are the first person to have this problem).
I found this page has quite a bit of background information on
C and C++ locales:
http://stdcxx.apache.org/doc/stdlibug/24-3.html
Boris
More information about the xsd-users
mailing list