_sprintf_l and _vsnprintf_l (and relatives) does not respect passed locale - by Tomek Z.1

Status : 

  Won't Fix<br /><br />
		Due to several factors the product team decided to focus its efforts on other items.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 523503 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 1/6/2010 12:18:42 PM
Access Restriction Public


Function _vsnprintf_l from CRT does not respect passed locale. When called, it calls 
e = _WCTOMB_S(&retval, L_buffer, _countof(L_buffer), *p++); 
in file output.c, which calls 
return _wctomb_s_l(pRetValue, dst, sizeInBytes, wchar, NULL);
in wctomb.c (please notice NULL instead of given locale). As a result call
_LocaleUpdate _loc_update(plocinfo);
in line 77 of wctomb.c resolves default locale instead of passed one.

Applies to _sprintf_l,  _vsnprintf_l, _sprintf_s_l,  _vsnprintf_s_l and possibly other relatives.
Sign in to post a comment.
Posted by Tomek Z.1 on 1/13/2010 at 6:04 AM
Please schedule this issue to fix in next release or remove "_locale" functions like _sprintf_l or _vsnprintf_l completely, as maintaining current state will confuse also users in future.
Posted by Microsoft on 1/13/2010 at 12:19 AM
Thanks for taking the time in submitting this issue. Unfortunately, given the priorities for current milestone we are in, the bug does not meet the bar for fixing in our next release. Please use the specified workaround if need to use these API. Given this decision, I am going to go ahead and resolve this as won't fix. If you have any questions or comments, feel free to reactivate the bug.

Thank you,
Visual Studio Libraries Team
Posted by Microsoft on 1/6/2010 at 9:53 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.

Thank you