Re: Why std::cout stop working when output MBCS string?



Ulrich Eckhardt wrote:
2. The way how this works might differ from system to system, the strings
passed to locale() are generally not portable. A portable way would be to
write a codecvt facet that converts internal wchar_t to external CP936, but
even that would have to be adjusted slightly for different sizes, encodings
and signednesses of wchar_t.

Dinkumware sells Dinkum Conversions Library that implements numerous codecvt not shipped with standard c++ library.


http://www.dinkumware.com/manuals/?manual=compleat&page=index_cvt.html

That would solve your problem since it ships cp936 codecvt.
.


Loading