Hi, The following code looks pretty suspicious to me: extern const wchar_t* pts; // pts = L"2004071" std::wistringstream wiss(pts); wtime_input_facet* wtif = new wtime_input_facet; wtif->set_iso_format(); wiss.imbue(std::locale(std::locale::classic(), wtif)); ptime pt; wiss >> pt; std::string dbgs = to_iso_string(pt); // dbgs == "20040711T000000" Seems to be a bug? TIA -- Serge
On Mon, 25 Jul 2005 19:32:48 +0400, Serge Skorokhodov wrote:
Hi,
The following code looks pretty suspicious to me:
extern const wchar_t* pts; // pts = L"2004071"
Is this a typo or did you intentionally leave your date string one character too short?
std::wistringstream wiss(pts); wtime_input_facet* wtif = new wtime_input_facet; wtif->set_iso_format(); wiss.imbue(std::locale(std::locale::classic(), wtif)); ptime pt; wiss >> pt; std::string dbgs = to_iso_string(pt); // dbgs == "20040711T000000"
Again, is this a typo? I got a different result when I ran this example.
Seems to be a bug?
Bart
Bart wrote:
On Mon, 25 Jul 2005 19:32:48 +0400, Serge Skorokhodov wrote:
Hi,
The following code looks pretty suspicious to me:
extern const wchar_t* pts; // pts = L"2004071"
Is this a typo or did you intentionally leave your date string one character too short?
No, it's not a typo. Actually, it's a part of a test. I expected
an error. Here is a complete example for vc-7_1.
#include
std::wistringstream wiss(pts); wtime_input_facet* wtif = new wtime_input_facet; wtif->set_iso_format(); wiss.imbue(std::locale(std::locale::classic(), wtif)); ptime pt; wiss >> pt; std::string dbgs = to_iso_string(pt); // dbgs == "20040711T000000"
Again, is this a typo? I got a different result when I ran this example.
I get the same error when run the sample above:( -- Serge
On Tue, 26 Jul 2005 11:11:52 +0400, Serge Skorokhodov wrote
Bart wrote:
On Mon, 25 Jul 2005 19:32:48 +0400, Serge Skorokhodov wrote:
Hi,
The following code looks pretty suspicious to me:
extern const wchar_t* pts; // pts = L"2004071"
Is this a typo or did you intentionally leave your date string one character too short?
No, it's not a typo. Actually, it's a part of a test. I expected an error. Here is a complete example for vc-7_1.
This should be fixed in CVS now -- will cause exceptions. See gregorian/testparse_date.cpp for new tests. Jeff
participants (3)
-
Bart
-
Jeff Garland
-
Serge Skorokhodov