18,356
社区成员
发帖
与我相关
我的任务
分享
//**************************************
// utf8hex转unicode字符串
// 返回大于0成功,小于0失败
//**************************************
int
u8hex_ustr( unsigned char *utf8hex, size_t length, WCHAR *unicodestr )
{
int result = 0;
try
{
int needlen = MultiByteToWideChar( CP_UTF8, 0, ( char * )utf8hex, -1, NULL, 0 );
if( needlen < 0 )
{
return needlen;
}
result = MultiByteToWideChar( CP_UTF8, 0, ( char * )utf8hex, -1, unicodestr, needlen );
return result;
}
catch( ... )
{
ShowError();
}
return result;
}
CA2W szUnicode(szUtf8, CP_UTF8);
CString strUnicode(szUnicode);