unicode转中文
来源:互联网 发布:知乎跳槽才能涨工资 编辑:程序博客网 时间:2024/06/16 23:04
/// <summary>
/// // Unicode转汉字 ,支持自动过滤非 unicode编码,即非 unicode编码不转换
/// 只支持 标准的 类型 \u4e00 这种格式的 转换, 以\u 开头的
/// code by 猿哥哥 2015-2-11
/// </summary>
function TMyEncode.UnicodeToChinese(inputstr:string):string;
var
i:Integer;
index:Integer;
temp,top,last:string;
begin
index:=1;
while index>=0 do
begin
index:= inputstr.IndexOf('\u');
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);
/// // Unicode转汉字 ,支持自动过滤非 unicode编码,即非 unicode编码不转换
/// 只支持 标准的 类型 \u4e00 这种格式的 转换, 以\u 开头的
/// code by 猿哥哥 2015-2-11
/// </summary>
function TMyEncode.UnicodeToChinese(inputstr:string):string;
var
i:Integer;
index:Integer;
temp,top,last:string;
begin
index:=1;
while index>=0 do
begin
index:= inputstr.IndexOf('\u');
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);
阅读全文
0 0
- C#中文转Unicode、Unicode转中文
- JAVA UNICODE转中文
- 中文 转 unicode 问题
- unicode 转 中文 ios
- 中文转Unicode
- unicode在线转中文
- unicode转中文
- Java unicode 转中文
- Python unicode 转中文
- 中文转码unicode
- Unicode编码转中文
- c#中文转unicode
- c#unicode转中文
- js unicode转中文
- php unicode转中文
- unicode文件转中文
- 中文转unicode
- unicode转中文
- 浏览器内核
- SQL2005\2008行转列脚本编写(表最后列加合计列或平均数列)
- 码流 / 码率 / 比特率 / 帧速率 / 分辨率 / 高清的区别
- MySQL时间相减问题
- Java中常用工具类
- unicode转中文
- 20170614修改框架水印设置
- FTP文件传输
- Android Eclipse项目转Android Studio
- Java多态
- Android 样式 —— layer-list 篇
- H264(NAL简介与I帧判断)
- webservice之cxf框架
- 在PPT中插入并嵌入SWF文件图文教程