delphi Ansi字符串转Unicode编码  
官方Delphi 学习QQ群: 682628230(三千人)
频道

delphi Ansi字符串转Unicode编码


function TForm1.AnsiToUnicode(Str: ansistring): string;
var
  s: ansistring;
  i:integer;
  j,k:string[2];
  a:array [1..1000] of  ansichar;
begin
  s:='';
  StringToWideChar(Str,@(a[1]),500);
  i:=1;
  while ((a[i]<>#0) or (a[i+1]<>#0)) do
  begin
    j:=IntToHex(Integer(a[i]),2);
    k:=IntToHex(Integer(a[i+1]),2);
    s:=s+'\u'+k+j;
    i:=i+2;
  end;
  Result:=s;
end;

————————————————

原文链接:https://blog.csdn.net/cc001100/article/details/81015182

推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.045448064804077 seconds