VS2012: strftime has incorrect return value in VC 11 with multibyte codepages - by Fozzy29

Status : 


Sign in
to vote
ID 766205 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 10/4/2012 3:33:47 PM
Access Restriction Public


I have noticed that VC11 returns different values for the AM/PM strings for non "C" / English locales than it did in VC10 and prior.

I believe this is a bug in the Microsoft C library.

strftime is required to null terminate the string it returns. The Microsoft implementatin does appear to be doing that however when a multibyte codepage is used it is returning the number of wide characters rather than the number of bytes copied.

If one ignores return value of strftime and instead looks at the individual characters returned to the output buffer the same characters are returned in VC 11 as in VC 10, it is just the return value of the number of characters that is incorrect.
Sign in to post a comment.
Posted by Raman [MSFT] on 1/25/2013 at 2:22 PM

Thanks for reporting this bug. We have verified that the behavior exhibited in this case is by design (as prescribed by the standard). Therefore we are going to close this bug as "By Design". Please feel free to write back directly at rasharma@microsoft.com if you feel otherwise.

Thanks you
Raman Sharma
Visual C++ Team
Posted by Microsoft on 10/4/2012 at 11:13 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Microsoft Visual Studio Connect Support Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Macy [MSFT] on 10/4/2012 at 3:53 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)