for i=1 to lenc(stringhz) chz=substrc(stringhz,i,1) if len(chz)=2 and Asc(left(chz, 1))>=0xB0 and Asc(left(chz, 1))<=0xF7 ctemp=ctemp+chz endif endfor 以上是vf写的,我想用dephi把它翻译过来,Asc(left(chz, 1))>=0xB0 不只怎么写?谢谢!
function ChinaToUnicode(const aWideStr: WideString): string; var sUnicodeHex: string; i : integer; begin for i := 1 to Length(aWideStr) do begin sUnicodeHex := Format('%.4x', [Word(aWideStr[i])]); sUnicodeHex := Chr(StrToInt('$' + Copy(sUnicodeHex, 3, 2))) + Chr(StrToInt('$' + copy(sUnicodeHex, 1, 2))); Result := Result + sUnicodeHex; end; end;汉字到Unicode的转换.
chz=substrc(stringhz,i,1)
if len(chz)=2 and Asc(left(chz, 1))>=0xB0 and Asc(left(chz, 1))<=0xF7
ctemp=ctemp+chz
endif
endfor
以上是vf写的,我想用dephi把它翻译过来,Asc(left(chz, 1))>=0xB0 不只怎么写?谢谢!
var
sUnicodeHex: string;
i : integer;
begin
for i := 1 to Length(aWideStr) do
begin
sUnicodeHex := Format('%.4x', [Word(aWideStr[i])]);
sUnicodeHex := Chr(StrToInt('$' + Copy(sUnicodeHex, 3, 2))) +
Chr(StrToInt('$' + copy(sUnicodeHex, 1, 2)));
Result := Result + sUnicodeHex;
end;
end;汉字到Unicode的转换.