- bsz
- ice_log
问:
在LiveChat里收到的汉字是Unicode后,人不可直接读出,怎么办?
答:
使用ice_log提供的页面可转换,参见后面的链接。
<html>
<head>
<title>unicode converter</title>
<div align=center>
<center>
<table border=0 cellpadding=0 cellspacing=0 style="border-collapse: collapse" width=600 id=AutoNumber1 height=26>
<tr>
<td width=100% height=26>
<p align=center><font face=黑体 size=5 color=#FF0000>unicode 转换工具</font></p>
<p>使用方法:</p>
<p>---在下面的文本框中输入字符,</p>
<p>---按"encode",可将字符转化为unicode。</p>
<p>---按"decode",可将unicode还原为字符。</p></td>
</tr>
</table>
</center>
</div>
<p align=center>
<textarea cols=82 rows=10 id=code>
</textarea> </p>
<p align=center>
<input type=button onclick=encode(code) value=encode>
<input type=button onclick=decode(code) value=decode>
<script>
function encode(obj){
obj.value=obj.value.replace(/[^\u0000-\u00FF]/g,function({post.content}){return escape({post.content}).replace(/(%u)(\w{4})/gi,"&#x;")});
}
function decode(obj){
obj.value=unescape(obj.value.replace(/&#x/g,'%u').replace(/;/g,''));
}
</script></p>
例子:
Unicode后的中文字符:
| 引用: |
%u600E%u4E48%u662F%u4E2D%u6587%u7684%uFF1F |
还原得到的汉字:
| 引用: |
怎么是中文的? |
链接:
Tags: HanZi HuanYuanChengHanZi unicode decode encode bsz ice_log CrucialWebhost
QQ群:2611874
安群网维基:http://anqun.cn
安群网论坛:http://bbs.anqun.cn
