Delphi Unicode转换Ansi


本文整理自网络,侵删。

 
function UnicodeToAnsi(aSubUnicode: string): string;
var
  tmpLen, iCount: Integer;
  tmpWS: WideString;
begin
  tmpWS := '';
  iCount := 1;
  tmpLen := Length(aSubUnicode);
  while iCount <= tmpLen do
    try
      if (Copy(aSubUnicode, iCount, 1) = '\')
        and (Copy(aSubUnicode, iCount, 2) = '\u') then
      begin
        tmpWS := tmpWS
          + WideChar(StrToInt('$' + Copy(aSubUnicode, iCount + 2, 4)));
        iCount := iCount + 6;
      end
      else
      begin
        tmpWS := tmpWS + Copy(aSubUnicode, iCount, 1);
        iCount := iCount + 1;
      end;
    except
    end;
  Result := tmpWS;
end;

相关阅读 >>

Delphi encddecd 加密解密

Delphi 读取流 image1 stream 加载到image2 timage 对象

Delphi 5-7 桥接让Delphi xe2 datasnap中间层支持Delphi低版本开发客户端

Delphi 转数字为大写金额源代码

Delphi xe android的所有权限按照分类总结说明

Delphi idtcpclient和idtcpserver主要属性

Delphi中禁用和取消android应用睡眠

Delphi 创建大窗口

Delphi制作移动文字、图片

Delphi中三种延时方法

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...

    暂无评论...