Y
yandong_mars
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TForm1.Button1Click(Sender: TObject);var a : String; b : String; Function MacCode2Chinese(AiUniCode : Integer) : String; Var ch, cl : Integer; Begin ch := AiUniCode Div 256; cl := AiUniCode Mod 256; Result := Chr(ch) + Chr(cl); end; //UniCode -> 汉字 Function UniCode2Chinese(AiUniCode : Integer) : String; Var ch, cl : String[3]; s : String; Begin s := IntToHex(AiUniCode, 2); cl := '$' + Copy(s, 1, 2); ch := '$' + Copy(s, 3, 2); s := Chr(StrToInt(ch)) + Chr(StrToInt(cl)) + #0; Result := WideCharToString(pWideChar(s)); end;begin// a := #20869#30721#36716#27721#23383; a := #$5185#$7801#$8F6C#$6C49#$5B57; showmessage(a);//显示:"内码转汉字" b := UniCode2Chinese($5185) + UniCode2Chinese($7801) + UniCode2Chinese($8F6C) + UniCode2Chinese($6C49) + UniCode2Chinese($5B57); showmessage(b);//在Delphi2010上显示是乱码 在Dephi2007上显示是 “内码转汉字”end;