这个肯定行。<br>function TForm1.GBCht2Chs(GBStr : String): AnsiString; //进行GBK繁体转简体<br>var<br> Len: Integer;<br> pGBCHTChar: PChar;<br> pGBCHSChar: PChar;<br>begin<br> pGBCHTChar := PChar(GBStr);<br> Len := MultiByteToWideChar(936,0,pGBCHTChar,-1,nil,0);<br> GetMem(pGBCHSChar,Len*2+1);<br> ZeroMemory(pGBCHSChar,Len*2+1);<br> //GB CHS -> GB CHT<br> LCMapString($804,LCMAP_SIMPLIFIED_CHINESE,pGBCHTChar,-1,pGBCHSChar,Len*2);<br> Result := String(pGBChsChar);<br> //FreeMem(pGBCHTChar);<br> FreeMem(pGBCHSChar);<br>end;<br><br>function TForm1.GBChs2Cht(GBStr : String): AnsiString; {进行GBK简体转繁体}<br>var<br> Len: Integer;<br> pGBCHTChar: PChar;<br> pGBCHSChar: PChar;<br>begin<br> pGBCHSChar := PChar(GBStr);<br> Len := MultiByteToWideChar(936,0,pGBCHSChar,-1,nil,0);<br> GetMem(pGBCHTChar,Len*2+1);<br> ZeroMemory(pGBCHTChar,Len*2+1);<br> //GB CHS -> GB CHT<br> LCMapString($804,LCMAP_TRADITIONAL_CHINESE,pGBCHSChar,-1,pGBCHTChar,Len*2);<br> Result := String(pGBCHTChar);<br> FreeMem(pGBCHTChar);<br> //FreeMem(pGBCHSChar);<br>end;