Delphi中Unicode转中文


本文整理自网络,侵删。

 function UnicodeToChinese(inputstr: string): string;
var
i: Integer;
index: Integer;
temp, top, last: string;
begin
index := 1;
while index >= 0 do
begin
index := Pos('\u', inputstr) - 1;
if index < 0 then
begin
last := inputstr;
Result := Result + last;
Exit;
end;
top := Copy(inputstr, 1, index); // 取出 编码字符前的 非 unic 编码的字符,如数字
temp := Copy(inputstr, index + 1, 6); // 取出编码,包括 \u,如\u4e3f
Delete(temp, 1, 2);
Delete(inputstr, 1, index + 6);
Result := Result + top + WideChar(StrToInt('$' + temp));
end;
end;

相关阅读 >>

Delphi 双击listbox1内容,数据插入到memo1/synedit1鼠标指定位置

Delphi 带密匙的字符串加密解密函数(支持中文)

Delphi jpeg图片压缩

Delphi 通用压缩单元

Delphi 让combobox只允许输入数字和回车键以及Delphi key值表

Delphi 系统服务和普通forms程序共存一体的实现

Delphi通过spcomm com口发短信包括pud编码解码

Delphi钩子注入程序

Delphi android 拨打电话

Delphi 通过控件句柄获取控件实例

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



打赏

取消

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

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

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

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

评论

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