本文整理自网络,侵删。
function UnicodeToChinese(inputstr: string): string;var 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 编码的字符,如数字 delphitop.com 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 多次改变 richedit.text部份文本的颜色后,出现所有字体都变色的的解决办法
Delphi提示‘error loading midas.dll’的原因及解决方案
Delphi中destroy, free, freeandnil, release用法和区别
Delphi winapi: getcurrentthread、getcurrentthreadid、getcurrentprocess、getcurrentprocessid
Delphi下用cdo发送邮箱实例(授权码cdo发送邮箱的解决办法)
更多相关阅读请进入《Delphi》频道 >>