首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

\u65b0\u6d6a\u4f53\u80b2\ 这样的怎么转成文字

2012-09-18 
\u65b0\u6d6a\u4f53\u80b2\ 这样的如何转成文字?一个网页里面存在\u65b0\u6d6a\u4f53\u80b2\的字符串,如何

\u65b0\u6d6a\u4f53\u80b2\ 这样的如何转成文字?
一个网页里面存在\u65b0\u6d6a\u4f53\u80b2\的字符串,如何转成字符啊?

[解决办法]

Delphi(Pascal) code
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;procedure TForm1.Button1Click(Sender: TObject);begin  showmessage(UnicodeToAnsi('\u65b0\u6d6a\u4f53\u80b2'));//显示“新浪体育”end; 

热点排行