Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

摘要

在使用 WideCharToMultiByte 將全形 Unicode 數位(U + FF10-U + FF19)轉換成標準半形數位(U +0030-U + 0039)時,無法在 Windows 95 和98上進行轉換。 其中一個應該使用 API LCMapString 和旗標 LCMAP_HALFWIDTH 將全形字元轉換為半形字元。

其他相關資訊

由於這個 API 的 W 版本無法在 Windows 95 上運作,因此 Windows 98 1 需要將全形字元從 Unicode 轉換為適當的 DBCS 字串,然後呼叫 LCMapString 進行轉換。 以下是使用繁體中文、簡體中文、日文和韓文的全形 Unicode 數位的範例:

#include <stdio.h>#include <tchar.h>#include <windows.h>void main(void){WCHAR T[2] = {65301, 0};TCHAR dbcs[3], conv[3];WideCharToMultiByte(CP_ACP, 0, T, -1, dbcs, sizeof(dbcs), NULL, NULL);int nRes = LCMapString(LOCALE_USER_DEFAULT, LCMAP_HALFWIDTH,                                                       dbcs,sizeof(dbcs),conv,sizeof(conv));printf("%s\n",conv);}

若要為 Windows 95 和 Windows 98 進行轉換作業,請在系統上安裝四個程式字碼頁的其中一個(950為繁體中文、936、簡體中文、的日文和932),並在上述 API 呼叫中明確設定 [程式字碼頁] 和 [地區識別碼] 參數。

參考

如需安裝程式字碼頁的詳細資訊,請按一下下列文章編號,以查看 Microsoft 知識庫中的文章:

如何安裝程式字碼頁

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×