Search

Wrong output in std::put_time by Egtra

Closed
as Fixed Help for as Fixed

1
0
Sign in
to vote
Type: Bug
ID: 735875
Opened: 4/7/2012 8:19:16 AM
Access Restriction: Public
0
Workaround(s)
0
User(s) can reproduce this bug
std::put_time in Visual C++ 11 β is not working correctly when locale is "Japanese_Japan". In Visual C++ 2010, It works correctly.
Details (expand)

Visual Studio/Team Foundation Server/.NET Frameworkツール製品名

Visual Studio 11 Beta

再現手順

Please compile and run following source code:

#include <iostream>
#include <iomanip>
#include <ctime>

int main()
{
    std::locale ja_jp("Japanese_Japan");

    auto time = std::time(nullptr);
    auto tm = std::localtime(&time);

    std::cout.imbue(ja_jp);
    std::cout << std::put_time(tm, "%c") << std::endl;

    char buf[1024];
    std::locale::global(ja_jp);
    std::strftime(buf, sizeof buf, "%c", tm);
    std::cout << buf << std::endl;
}

製品言語

Japanese

オペレーティング システム

Windows Server 2008 R2

オペレーティング システム言語

Japanese

実際の結果

?n?n/04/08 :08:40
刈n?
:08:40
2012/04/08 0:08:40

期待した結果

2012/04/08 0:08:40
2012/04/08 0:08:40
File Attachments
0 attachments
Sign in to post a comment.
Posted by Microsoft on 5/9/2012 at 4:40 PM
Hi,

Thanks for reporting this bug. We've fixed it, and the fix will be available in VC11 RTM.

If you have any further questions, feel free to E-mail me at stl@microsoft.com .

Stephan T. Lavavej
Visual C++ Libraries Developer
Posted by Microsoft on 4/8/2012 at 8:13 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by MS-Moderator01 on 4/8/2012 at 6:42 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.