我想用求汉字的asc码,例如,我想求出‘我’的asc码是多少,怎么求? 在线等!

解决方案 »

  1.   

    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 不只怎么写?谢谢!
      

  2.   

    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的转换.