[問題] gcc下multibytetowidechar()的問題
環境是xp+gcc
//---------------------------
#include <stdio.h>
#include "windows.h"
main()
{
char ansi[]="bibo嘿嘿5566";
wchar_t unico[200];
int n=MultiByteToWideChar(CP_ACP, 0, ansi, -1, 0, 0);
printf("n=%d",n);
MultiByteToWideChar(CP_ACP, 0, ansi, -1, unico, n);
wprintf(L"%s",unico);
}
//---------------------------
抓到的n是正確的11
但是轉出來的string一遇到中文字就停了
也就是只會顯示bibo
請問這是哪裡出問題?
thanx
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.38.3.204
※ 編輯: varg 來自: 114.38.3.204 (08/23 19:29)
→
08/23 19:34, , 1F
08/23 19:34, 1F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章