69,369
社区成员
发帖
与我相关
我的任务
分享
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <locale.h>
int main(void)
{
wchar_t *wcs = L"大钟寺";
char buf[255] = {0};
setlocale(LC_ALL, "Chinese");
wcstombs(buf, wcs, 254);
return 0;
}
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <locale.h>
int main(void)
{
wchar_t *wcs = L"大钟寺";
char buf[255] = {0};
wchar_t wbuf[255] = {0};
setlocale(LC_ALL, "Chinese");
wcstombs(buf, wcs, 254);
mbstowcs(wbuf, buf, 254);
return 0;
}