Java uses the UTF-8 format string, where Java communicates with C + + to convert UTF-8 strings to Unicode strings, such as "ABCDABCD Chinese people xiasha 123." After converting to Unicode, the appearance is as follows:
\u41\u42\u43\u44\u61\u62\u63\u64\u4e2d\u56fd\u4eba\u6c11\u4e0b\u6c99\u31\u32\u33\u2e\u676d\u5dde
VC in the following processing can be turned back
CString cxxclass::unicodetostring () {CString Strunicode = _t ("\\u41\\u42\\u43\\u44\\u61\\u62\\u63\\u64\\u4e2d\\ U56fd\\u4eba\\u6c11\\u4e0b\\u6c99\\u31\\u32\\u33\\u2e\\u676d\\u5dde "); INT iStart = 0, iend = 0; CString strtmp, Strout; TCHAR C; BOOL bEnd = false;for (INT i = 0; i < strunicode.getlength (); ++i) {iend = Strunicode.find (_t (' \\u '), IStart); if (Iend & Lt 0) {iend = Strunicode.getlength (); bEnd = TRUE;} strtmp = Strunicode.mid (IStart + 1, iend-istart-1), if (!strtmp.isempty ()) {swscanf_s (Strtmp.getbuffer (), _t ("%x"), & ; c); Strtmp.releasebuffer (); Strout + = C;} IStart = iend + 1;if (bEnd) {break;}} return strout;}
There should be a better way to welcome the exchange.
VC with Chinese and English \u format Unicode string to Unicode visible string