现在有一个字符数组定义如下:
var
Content:array[0..159]of char;其中用两个字符表示一个汉字,汉字用Unicode编码。
例如:“你好”
Content[0]:=#79  十六进制为4F
Content[1]:=#96  十六进制为60
Content[2]:=#89  十六进制为59
Content[3]:=#125 十六进制为7D如何把这个数组转变成一个字符串?

解决方案 »

  1.   

    procedure TForm1.FormCreate(Sender: TObject);
    var
    Content:array[0..159]of char;
    ws:widestring;
    begin
    //'你好'
    Content[0]:=#196;
    Content[1]:=#227;
    Content[2]:=#186;
    Content[3]:=#195;
    ws:=Content[0]+Content[1]+Content[2]+Content[3];
    caption:=ws;
    end;
      

  2.   

    转成字符串和Unicode有什么关系?
    var
       String str;
    begin
        Str := pChar(Content);
    end;如果是Unicode,使用WideChar类型的函数处理才行
      

  3.   

    不用ws也行,caption 或者string 会自动识别
      

  4.   

    TO blucecat(一言稀音)
    我的编码是Unicode,和你的给的不一样,他们之间如何转换?
      

  5.   

    Tnt Delphi Unicode Controls
    http://home.ccci.org/wolbrink/tnt/delphi_unicode_controls.htm