//转换Gb码繁体到Gb码简体,使用API函数LCMapString LCMapString(0x0804,LCMAP_SIMPLIFIED_CHINESE, pszGbt, -1, pszGbs, iLen); //返回Gb码简体字符 sGb=pszGbs; //释放内存 delete [] wszUnicode; delete [] pszGbt; delete [] pszGbs; return sGb; } 2. 输入Gb字符,返回Big5字符 //--------------------------------------------------------------------------- //函数输入Gb字符,返回Big5字符 //--------------------------------------------------------------------------- AnsiString __fastcall Gb2Big(AnsiString sGb) { char* pszGbt=NULL; //Gb编码的繁体字符 char* pszGbs=NULL; //Gb编码的简体字符 wchar_t* wszUnicode=NULL; //Unicode编码的字符 char* pszBig5=NULL; //Big5编码的字符 AnsiString sBig5; //返回的字符串 int iLen=0; //需要转换的字符数 pszGbs=sGb.c_str(); //读入需要转换的字符参数
|