首页 > Windows开发 > 详细

Delphi中Unicode转中文

时间:2018-06-08 10:22:07      阅读:239      评论:0      收藏:0      [点我收藏+]
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;  

https://blog.csdn.net/u012942868/article/details/52882736

 

Delphi中Unicode转中文

原文:https://www.cnblogs.com/westsoft/p/9153787.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!