<html>
<head>
<title>GB2312 TO Unicode</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 bgcolor="#EDF9FE">
<p align=center><font face=黑体 size=5 color=#FF0000><b>Unicode 转换工具</b></font></p>
<p>在下面的文本框中,输入中文文字</p>
<p> 按“转换”,即可将其转化为unicode字符。</p>
<p> 再按“还原”,即可将其还原为简体中文。</p>
</tr>
</table>
</center>
</div>
<p align=center>
<textarea cols=82 rows=15 id=code>
</textarea></p>
<p align=center>
<input type="button" οnclick="encode(code,this);" value="转化成Unicode字符" />
<input type="button" οnclick="encode2(code,this);" value="还原为简体中文" />
<script>
var mode="zhuan";
function encode(obj,btn){
obj.value=obj.value.replace("\'","ch39")
obj.value=obj.value.replace(/[^\u0000-\u00FF]/g,function($0){return escape($0).replace(/(%u)(\w{4})/gi,"\\u$2")});
//btn.value="还原为简体中文";
mode="huan";
}
function encode2(obj,btn){
obj.value=unescape(obj.value.replace(/\\u/g,'%u'));
//btn.value="转化成Unicode字符";
}
</script></p>
</head>
<input type="checkbox" onClick="return false" checked readonly >
</html>