文件名称:Delphi简体转繁体—繁体转简体
文件大小:2KB
文件格式:TXT
更新时间:2013-09-25 02:28:17
Delphi 简体转繁体 繁体转简体
function GBCht2Chs(GBStr: string): AnsiString; function GBChs2Cht(GBStr: string): AnsiString; implementation function GBCht2Chs(GBStr: string): AnsiString; {进行GBK繁体转简体} var Len: integer; pGBCHTChar: PChar; pGBCHSChar: PChar; begin pGBCHTChar := PChar(GBStr); Len := MultiByteToWideChar(936, 0, pGBCHTChar, -1, nil, 0); GetMem(pGBCHSChar, Len * 2 + 1); ZeroMemory(pGBCHSChar, Len * 2 + 1); //GB CHS -> GB CHT LCMapString($804, LCMAP_SIMPLIFIED_CHINESE, pGBCHTChar, -1, pGBCHSChar, Len * 2); result := string(pGBCHSChar);