[Boost-bugs] [Boost C++ Libraries] #1726: boost/date_time/posix_time/time_formatters.hpp incorrectly formats fractional seconds using global locale

Subject: [Boost-bugs] [Boost C++ Libraries] #1726: boost/date_time/posix_time/time_formatters.hpp incorrectly formats fractional seconds using global locale
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-03-28 22:51:42


#1726: boost/date_time/posix_time/time_formatters.hpp incorrectly formats
fractional seconds using global locale
-----------------------------------+----------------------------------------
 Reporter: jplejacq_at_[hidden] | Owner: az_sw_dude
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: date_time
  Version: Boost 1.34.1 | Severity: Problem
 Keywords: locale |
-----------------------------------+----------------------------------------
 The function boost::posix_time::to_iso_string_type() uses the
 ostream::operator<<() function to write the time. This later function will
 use the current global locale to format each of the elements of the time.
 In particular, when the global locale is set to en_US, the fractional will
 be formatted to be 123,456 when there are six digits, which is incorrect.

 The proposed solution is to temporarily imbue the ostream with the classic
 locale to disable formatting. The attached patch only applies this to the
 fractional seconds but it would be more robust to apply to the other time
 components as well.

 This type of error probably exists in other functions. In particular see
 Ticket #1674 which is the same error.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1726>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC