[Boost-bugs] [Boost C++ Libraries] #1674: date_time::date_formatting.hpp: incorrectly formats year using global locale

Subject: [Boost-bugs] [Boost C++ Libraries] #1674: date_time::date_formatting.hpp: incorrectly formats year using global locale
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-03-06 18:14:22


#1674: date_time::date_formatting.hpp: incorrectly formats year using global
locale
-----------------------------------+----------------------------------------
 Reporter: jplejacq_at_[hidden] | Owner: az_sw_dude
     Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: date_time
  Version: Boost 1.34.1 | Severity: Problem
 Keywords: locale formatting |
-----------------------------------+----------------------------------------
 The function boost::date_time::ymd_formatter::ymd_to_string() uses the
 ostream<<() function to write the date. This later function will use the
 current global locale to format each of the elements of the date. In
 particular, when the global locale is set to en_US, the year will be
 formatted to be 2,008 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
 year but it would be more robust to apply to the day and month components
 as well.

 This type of error probably exists in other functions.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1674>
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