gb2312unicode字符转换
来源:互联网 发布:ubuntu镜像的安装教程 编辑:程序博客网 时间:2024/06/06 18:55
整理了一下gb2312 unicode转换工具,具体代码如下:
HTML代码:
<head>
<title>gb2312 unicode转换工具</title>
</head>
<body>
<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>
在下面的文本框中输入中文文字,按“转换”,即可将其转化为unicode字符。</p>
<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,this)" value="转化" />
<script type="text/javascript" language="javascript">
<!--下方代码-->
</script>
</p>
</body>
</html>
javascript:
<script type="text/javascript" language="javascript">
var mode="zhuan";
function encode(obj,btn){
if(mode=="zhuan"){
obj.value=obj.value.replace(/[^/u0000-/u00FF]/g,function($0){return escape($0)});
obj.value = obj.value.replace(/%/g,'//');
btn.value="还原";
mode="huan";
}else{
obj.value = obj.value.replace(////g,'%');
obj.value=unescape(obj.value.replace(/&#x/g,'%u').replace(/;/g,''));
btn.value="转换";
mode="zhuan";
}
}
</script>
- gb2312unicode字符转换
- 转换字符
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 字符转换
- 如何编写 Windows Mobile Smartphone 录音程序
- js技巧收集(200多个)
- javascript Web页面内容导出到Word、Excel
- PMI推出新认证:PgMP 项目集管理
- 强类型数据集对象(引用)
- gb2312unicode字符转换
- 考查嵌入式C开发人员的最好的0x10道题
- Database Header Page for Jet 3.x
- C语言函数调用的底层机制
- Ajax+servlet实现聊天室
- 重写string.h中的字符串操作函数--memmove、memcpy
- 性格类型的沟通
- 复习C字符串处理
- 关于字节对齐