如题.最好是用代码来实现转换,谢谢.

解决方案 »

  1.   

    这应该是unicode编码所代表的数字呵,很久以前做个这个,现在有点忘了好象Delphi带了unicodeDecode和unicodeEecode吧我试试看再说
      

  2.   

    这个是我写的转换Delphi窗体文件的。其实没什么技巧,就是用WideChar将数字转换为字符而已。
    function UnicodeStrToStr(S:string):WideString;
    var
       tls:TStringList;
       i:Integer;
       M:WideString;
       One:Integer;
       J:Integer;
       S1,S2:string;
       K:Char;
       Black:Boolean;
       Has:Boolean;
    begin
      One:=Pos('#',S);
      if (One=0)or(Pos('font',LowerCase(S))>0)or(Pos('mask',LowerCase(S))>0)or(Pos('displayformat',LowerCase(S))>0) then
        Result:=S
      else begin
        if S[Length(S)] in [')',']','+'] then
        begin
          K:=S[Length(S)];
        end
        else K:=#0;
        M:=Copy(S,1,One-1);
        if K<>#0 then
          S:=Copy(S,One+1,Length(S)-One-1)
        else
          S:=Copy(S,One+1,Length(S)-One);
        if Trim(M)<>'' then
        begin
          if M[Length(M)]='''' then
          begin
            M:=Copy(M,1,Length(M)-1);
            Has:=True;
          end
          else Has:=False;
          Black:=False;
        end
        else  begin
          Black:=True;
          Has:=False;
        end;    tls:=TStringList.Create;
        try
          PartitionString(S,'#',tls,True);
          if (not Has)and((Copy(S,1,2)<>'10')or((Copy(S,1,2)='10')and(IsInteger(Copy(S,1,3))))) then
            M:=M+'''';
          for I:=0 to tls.Count-1 do
          begin
            if tls[I]<>'' then
            begin
              J:=Pos('''',tls[I]);
              if J=0 then
              begin
                if tls[I]='13' then
                begin
                  M:=M+'''#13';
                end
                else if tls[I]='10' then
                begin
                  M:=M+'#10''';
                end
                else begin
                  if (I=0)and (tls.Strings[I]='39')and Has then
                    M:=M+'''';
                  M:=M+WideChar(StrToInt(tls.strings[I]));
                  if (((I=0)and Black) or(I>0))and(tls.Strings[I]='39') then
                    M:=M+'''';
                end;
              end
              else begin
                S1:=Copy(tls[I],1,J-1);
                S2:=Copy(tls[I],J+1,Length(tls[I])-J-1);
                if S1='13' then
                begin
                  M:=M+'''#13';
                end
                else if S1='10' then
                begin
                  M:=M+'#10'''+S2;
                end
                else begin
                  if (I=0)and (S1='39')and Has then
                    M:=M+'''';
                  M:=M+WideChar(StrToInt(S1));
                  if (((I=0)and Black) or(I>0))and(S1='39') then
                    M:=M+'''';
                  M:=M+S2;
                end;
              end;
            end;
          end;
          if tls[tls.Count-1]<>'13' then
            M:=M+'''';
          if K<>#0 then
            Result:=M+K
          else Result:=M;
        finally
          tls.Free;
        end;
      end;
    end;
      

  3.   

    里面有个函数:
    {将字符串分割成一个StringList}
    procedure PartitionString(StrV,PrtSymbol:string;strList:TStrings;KillBlack:Boolean=True);
    var
      iTemp: integer;
    begin
      strList.Clear;
      iTemp := pos(PrtSymbol,StrV);
      while iTemp>0 do begin
        if iTemp>1 then
        begin
          if KillBlack then
            StrList.Append(Trim(copy(StrV,1,iTemp-1)))
          else
            StrList.Append(Copy(StrV,1,iTemp-1));
        end;
        delete(StrV,1,iTemp+length(PrtSymbol)-1);
        iTemp := pos(PrtSymbol,StrV);
      end;
      if KillBlack then
        if Trim(Strv)<>'' then
          StrList.Append(Trim(StrV))
      else if StrV<>'' then
        StrList.Append(StrV);
    end;
      

  4.   

    谢谢 mastersky(浪) 
    不过文字为什么变成了数字,能不能指点下!在次感谢!
      

  5.   

    文字变成数字是因为它转换成Unicode了。平常1个汉字占2个字节,1个Unicode字符占4个字节。#26032#32048#26126#39636分别是4个Unicode字符.
    有关Unicode字符的说明介绍,你在Google里面搜索一下,很多的.