Boost logo

Boost Users :

From: Paolo Coletta (paolo_at_[hidden])
Date: 2005-05-27 19:10:02


I'm not sure if this is a bug or if I'm misusing the library. It seems
that serializing boost::posix_time_ptime fails when using non-standard
locale (Windows Xp OS - vc 7.1 compiler - boost updated from CVS few
days ago).

As an example, try adding

std::locale::global( std::locale( "en" ) );

as the first line of the testtime_serialize.cpp; this causes the test to
fail when doing

ia >> pt2;

I tried to understand what was happening, and it seems to me that the
problem is in keeping into account locale when serializing, while
ignoring it while unserializing.
In greg_serialize.hpp
to_iso_string(d)
may generate something like "2,0050527"; the method
from_undelimited_string(ds)
used to load the serialized date, expects a 4,2,2 format.

Paolo


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net