Delphi 10.1 Berlin UTF8String Test

Delphi 10.1 Berlin UTF8String Test

procedure TForm1.Button1Click(Sender: TObject);
var s: UTF8String;
    i: Integer;
begin
     s := UTF8Encode('123中文测试');

     Memo1.Lines.Add(UTF8Decode(s));

     for i:=Low(s) to High(s) do
         Memo1.Lines.Add(i.ToString + ' : ' + IntToHex(Ord(s[i]), 2));
end;

 

posted @ 2016-05-06 10:54  龟山Aone  阅读(1247)  评论(1编辑  收藏  举报