[問題] gcc下multibytetowidechar()的問題

看板C_and_CPP (C/C++)作者時間16年前 (2009/08/23 19:13), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
環境是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
其實11正不正確我也不太確定 big5不是2byte嗎
08/23 19:34, 1F
文章代碼(AID): #1AaIGyLD (C_and_CPP)
文章代碼(AID): #1AaIGyLD (C_and_CPP)