vc6中如何将“\U+00D7”转换成“×”
vc6中如何将“\U+00D7”转换成“×”
[解决办法]
//“\U+00D7”转换成“×”
#include <locale.h>
#include <stdio.h>
#include <windows.h>
char s[]="\\U+00D7";
wchar_t w;
char m[3];
int main() {
setlocale(LC_ALL,"chs");
sscanf(s,"\\U+%4X",&w);
WideCharToMultiByte(CP_ACP,0,&w,1,m,2,NULL,FALSE);
m[2]=0;
printf("[%s]\n",m);
return 0;
}
//[×]
//