I have problem with codecvt<>
-
locale loc("chs");
mbstate_t mystate;
char origin[] = "追求追求";
wchar_t dest[9] = { 0 };
const char * pc;
wchar_t * pwc;const codecvt& myfacet =
use_facet >(loc);codecvt<>.in() translates char into wchar_t characters, but the first letter of origin[] is always translated wrong,the remaining characters are fine. could someone help me out?
-
locale loc("chs");
mbstate_t mystate;
char origin[] = "追求追求";
wchar_t dest[9] = { 0 };
const char * pc;
wchar_t * pwc;const codecvt& myfacet =
use_facet >(loc);codecvt<>.in() translates char into wchar_t characters, but the first letter of origin[] is always translated wrong,the remaining characters are fine. could someone help me out?
Cold_Fearing_Bird wrote:
char origin[] = "追求追求";
You are trying to set a unicode/wide string to ANSI buffer.