Platform SDK: International Features
//软件语言国际化
char* TSTransform(const char* pStrSrc, int nToTS, char* pStrDst){
LCID lcid = MAKELCID(MAKELANGID(LANG_CHINESE,SUBLANG_CHINESE_SIMPLIFIED),SORT_CHINESE_PRC);
int nLength = LCMapStringA(lcid, nToTS, pStrSrc, -1, NULL, 0);
LCMapStringA(lcid, nToTS, pStrSrc, -1, pStrDst, nLength); // 字体转换
return pStrDst;
}
char* SimplifiedToTraditional(const char* pStrSimplified, char* pDstStrTraditional)
{
return TSTransform(pStrSimplified, LCMAP_TRADITIONAL_CHINESE,pDstStrTraditional);//LCMAP_TRADITIONAL_CHINESE 指定转换的类型,将简体字转成繁体字
}
注:
DWORD MAKELCID( WORD wLanguageID, // language identifier
WORD wSortID // sorting identifier);
WORD MAKELANGID( USHORT usPrimaryLanguage, // primary language identifier
USHORT usSubLanguage // sublanguage identifier);
int LCMapString( LCID Locale, // locale identifier
DWORD dwMapFlags, // mapping transformation type
LPCTSTR lpSrcStr, // source string
int cchSrc, // number of characters in source string
LPTSTR lpDestStr, // destination buffer
int cchDest // size of destination buffer);
此文本仅作为本人整理笔记使用。