字符转换Unicode编码工具
来源:互联网 发布:侧边栏显示隐藏js特效 编辑:程序博客网 时间:2024/05/19 00:08
dragchong 发表的转换Unicode编码工具
原帖: http://download.csdn.net/source/686839
我修改了下CSS...
-------------------------- 附代码 --------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-cn" xml:lang="zh-cn">
<head> <title>字符转换Unicode编码工具</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-language" content="zh-cn" />
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-style-type" content="text/javascript" />
<script language='JavaScript'>
function doit() {
var str = source.value;
var tmp1 = "";
var tmp2 = "";
var tmp3 = "";
for (var i = 0; i < str.length; i++) {
if (str.charCodeAt(i) < 128) {
tmp1 += str.charAt(i);
tmp2 += str.charAt(i);
tmp3 += str.charCodeAt(i) + ",";
}
else {
tmp1 += "&#"+str.charCodeAt(i)+";";
tmp2 += "//u"+(str.charCodeAt(i)).toString(16);
tmp3 += str.charCodeAt(i) + ",";
}
}
dest1.value = tmp1;
dest2.value = tmp2;
dest3.value = tmp3;
}
function doAntiHtml() {
var str = dest1.value;
var tmp1 = "";
for (var i = 0; i < str.length; i++) {
if (str.charCodeAt(i) == 10) {
tmp1 += "<br/>";
}
else if (str.charCodeAt(i) == 13) {
}
else if (str.charAt(i) == '<') {
tmp1 += "&";
}
else if (str.charAt(i) == '>') {
tmp1 += "&";
}
else {
tmp1 += str.charAt(i);
}
}
var dd = window.open("");
dd.document.body.innerHTML = tmp1;
}
function doAntiJava() {
var str = dest2.value;
var tmp1 = "";
for (var i = 0; i < str.length; i++) {
if (str.charCodeAt(i) == 10) {
tmp1 += "<br/>";
}
else if (str.charCodeAt(i) == 13) {
}
else if (str.charAt(i) == '<') {
tmp1 += "&";
}
else if (str.charAt(i) == '/'') {
tmp1 += "///'";
}
else if (str.charAt(i) == '//') {
if (i < (str.length - 1) && str.charAt(i + 1) != 'u') {
tmp1 += "////";
}
else {
tmp1 += "//";
}
}
else if (str.charAt(i) == '>') {
tmp1 += "&";
}
else {
tmp1 += str.charAt(i);
}
}
var dd = window.open("");
dd.document.write("<script>document.write('"+tmp1+"');");
dd.document.write("<");
dd.document.write("/script>");
}
</script>
<style type="text/css">
<!--
html,bod
{width: "738px";margin: 0PX; font:100%/120% Verdana, Arial, Helvetica, sans-serif, 宋体;
padding: 0; margin-align: center; }
td {font-weight: bold; color:#E25B18;}
a { text-decoration:none;}
a:hover{text-decoration:none; color:red;}
-->
</style>
</head>
<body> <div style='background-color: #effae4;'> </div>
<p align="center"><font color="#800000" face="楷体_GB2312" size="5">字符转换Unicode编码</font> </p>
<table cellspacing="12" cellpadding="0" width="550px" align="center" bgcolor="#E2F2FD" border="0">
<tbody>
<tr>
<td align="center" bgcolor="#F1F9FE">
<textarea id="source" rows="6" cols="60"></textarea> <br/>
源数据:<input type="button" value="编 码" onclick="doit();"/><br/><br/>
<textarea id="dest1" rows="6" cols="60"></textarea></textarea> <br/>
HTML Unicode编码:<input type="button" value="反编码" onclick="doAntiHtml();"/> <br/><br/>
<textarea id="dest2" rows="6" cols="60"></textarea></textarea> <br/>
JAVA Unicode编码:<input type="button" value="反编码" onclick="doAntiJava();"/> <br/><br/>
<textarea id="dest3" rows="6" cols="60"></textarea> <br/>Unicode编码值:
</td></tr></tbody></table>
<div align=right style="COLOR: #15B308;"><i><tt>
by bobo55 <br>
Last updated: <script>document.write(document.lastModified)</script></tt></i> </div>
</body>
</html>
- 字符转换Unicode编码工具
- Unicode编码转换工具
- Unicode编码转换工具
- unicode 编码转换工具
- Unicode字符转换工具
- 字符编码转换(utf8-unicode)
- unicode编码转换工具类
- unicode 编码在线转换工具
- unicode 编码在线转换工具
- 字符编码转换工具
- unicode编码转换为字符的形式
- 字符编码各种转换:utf8,unicode
- Javascript 转换&#x的unicode编码字符
- Unicode编码解码在线转换工具
- Unicode编码解码在线转换工具
- Unicode编码解码在线转换工具
- Unicode编码解码在线转换工具
- 字符编码(unicode编码)
- ALinq1.3(由LinqToAccessDB改名)源码发布--支持Access、SQLite、MySql、Oracle四种数库
- 复制表(结构,结构+数据)
- C#设计模式(9)-Prototype Pattern
- 拷贝表(拷贝数据)
- C#设计模式(10)-Adapter Pattern
- 字符转换Unicode编码工具
- 显示文章、提交人和最后回复时间
- C#设计模式(11)-Composite Pattern
- 怎样去做
- 在java中用jxl创建Excel文件
- ORACLE临时表,产生一个类似于MST表
- 《开源合辑-通讯->AJAX》
- C#设计模式(12)-Decorator Pattern
- 软件项目经理必备素质