id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 11848,Win32 backend bug when do wide char convert to multi byte in boost::locale,fyrestone@…,Artyom Beilis,"The function wide_to_multibyte_non_zero in locale/src/encoding/wconv_codepage.ipp has bug. This function assume that when the codepage is CP_UTF7 or CP_UTF8, the substitute_ptr and subst_char_ptr will be 0. But, in x64 Windows 10, I use codepage 54936 get 87 error code after the first WideCharToMultiByte called. This will make n is zero, and the second WideCharToMultiByte call will make the program crash. In MSDN shipped with Visual Studio .NET 2003 it is said that parameters lpDefaultChar and lpUsedDefaultChar must be NULL not only for CP_UTF7 and CP_UTF8, but also for all codepages mentioned in notes for dwFlags parameter: 50220 50221 50222 50225 50227 50229 57002 through 57011 65000 (UTF-7) 42 (Symbol) It is still true as of Windows 8 & 10: if you try to call BOOL bVal = FALSE; WideCharToMultiByte(50220, 0, L""asdf"", 4, NULL, 0, NULL, &bVal); You'll get 0 with GetLastError 87 (ERROR_INVALID_PARAMETER).",Bugs,assigned,To Be Determined,locale,Boost 1.59.0,Problem,,,