应该这样:
从UNICODE得到汉字:
var
wide_charwidechar;
begin
wide_char:=#35775;
showmessage(WideCharToString(wide_char));
end;
-----------
从汉字得到UNICODE:
function AnsiToUnicode(Ansi: string):string;
var
s:string;
i:integer;
j,k:string[2];
a:array [1..1000] of char;
begin
s:='';
StringToWideChar(Ansi,@(a[1]),500);
i:=1;
while ((a<>#0) or (a[i+1]<>#0)) do begin
j:=IntToHex(Integer(a),2);
k:=IntToHex(Integer(a[i+1]),2);
s:=s+k+j;
i:=i+2;
end;
Result:=s;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
st:string;
begin
st:='访';
showmessage(inttostr(StrToInt('$'+AnsiToUnicode(st))));
end;