AW: [xsd-users] serialize problems: thousands separator in
gyear_month and unsigned long
Sibinger Peter
Peter.Sibinger at cpg.de
Thu Feb 26 04:09:00 EST 2015
Hi Boris,
Many thanks for your help and your quick reply.
I hadn't been aware that I changed my global locale.
I have to change my software in that way.
Best regards,
Peter
-----Ursprüngliche Nachricht-----
Von: Boris Kolpackov [mailto:boris at codesynthesis.com]
Gesendet: Mittwoch, 25. Februar 2015 16:54
An: Sibinger Peter
Cc: xsd-users at codesynthesis.com
Betreff: Re: [xsd-users] serialize problems: thousands separator in gyear_month and unsigned long
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