url 汉字乱码全方位解析
2011-11-07 18:26
295 查看
<html>
<head>
<script>
var encode = escape('排行');
alert(encode);
alert('排行');
function covert(){
var z = document.getElementById('dd').value;
document.getElementById('ecode').value = escape(z);
}
function uncovert(){
var z = document.getElementById('dd1').value;
document.getElementById('ecode1').value = unescape(z);
}
function encodeURIComponent1(){
alert('ddd');
var z = document.getElementById('dd2').value;
document.getElementById('ecode2').value = encodeURIComponent(z);
}
function encodeURI1(){
var z = document.getElementById('dd3').value;
document.getElementById('ecode3').value = encodeURI(z);
}
function decodeURI1(){
var z = document.getElementById('dd4').value;
document.getElementById('ecode4').value = decodeURI(z);
}
</script>
</head>
<body>
<br/>
<input id = 'dd' type ="text" value ='' style="width:100px;"/>
<input id= "button" type ="button" value="转换" onclick="covert();"/>
<input id = 'ecode' type ="text" value =''/>
<br/>
<input id = 'dd1' type ="text" value =''/>
<input id= "unbutton" type ="button" value="反转换" onclick="uncovert();"/>
<input id = 'ecode1' type ="text" value =''/>
<br/>
<input id = 'dd2' type ="text" value =''/>
<input id= "unbutton1" type ="button" value="encodeURIComponent" onclick="encodeURIComponent1();"/>
<input id = 'ecode2' type ="text" value =''/>
<br/>
<input id = 'dd3' type ="text" value =''/>
<input id= "unbutton2" type ="button" value="encodeURI" onclick="encodeURI1();"/>
<input id = 'ecode3' type ="text" value =''/>
<br/>
<input id = 'dd4' type ="text" value =''/>
<input id= "unbutton3" type ="button" value="decodeURI" onclick="decodeURI1();"/>
<input id = 'ecode4' type ="text" value =''/>
<a id = "a1" href = "a.html?id=排行">a</a>
</body>
</html>
<head>
<script>
var encode = escape('排行');
alert(encode);
alert('排行');
function covert(){
var z = document.getElementById('dd').value;
document.getElementById('ecode').value = escape(z);
}
function uncovert(){
var z = document.getElementById('dd1').value;
document.getElementById('ecode1').value = unescape(z);
}
function encodeURIComponent1(){
alert('ddd');
var z = document.getElementById('dd2').value;
document.getElementById('ecode2').value = encodeURIComponent(z);
}
function encodeURI1(){
var z = document.getElementById('dd3').value;
document.getElementById('ecode3').value = encodeURI(z);
}
function decodeURI1(){
var z = document.getElementById('dd4').value;
document.getElementById('ecode4').value = decodeURI(z);
}
</script>
</head>
<body>
<br/>
<input id = 'dd' type ="text" value ='' style="width:100px;"/>
<input id= "button" type ="button" value="转换" onclick="covert();"/>
<input id = 'ecode' type ="text" value =''/>
<br/>
<input id = 'dd1' type ="text" value =''/>
<input id= "unbutton" type ="button" value="反转换" onclick="uncovert();"/>
<input id = 'ecode1' type ="text" value =''/>
<br/>
<input id = 'dd2' type ="text" value =''/>
<input id= "unbutton1" type ="button" value="encodeURIComponent" onclick="encodeURIComponent1();"/>
<input id = 'ecode2' type ="text" value =''/>
<br/>
<input id = 'dd3' type ="text" value =''/>
<input id= "unbutton2" type ="button" value="encodeURI" onclick="encodeURI1();"/>
<input id = 'ecode3' type ="text" value =''/>
<br/>
<input id = 'dd4' type ="text" value =''/>
<input id= "unbutton3" type ="button" value="decodeURI" onclick="decodeURI1();"/>
<input id = 'ecode4' type ="text" value =''/>
<a id = "a1" href = "a.html?id=排行">a</a>
</body>
</html>
相关文章推荐
- JS获取URL后的参数并且解析汉字乱码
- Jsoup.connect(url).get()解析html页面空格&bsp乱码问题
- .net 解决js传递参数时,url汉字乱码问题
- 解决前台传入汉字在后台解析时会乱码
- js传递汉字类型参数值乱码问题,以及url传递多个参数报违法的参数值
- Extjs中用url动态传参到后台的汉字为乱码
- servlet和action中获取URL中的汉字(解决URL中汉字为乱码的问题)
- ASP.NET中url传递中文的解决方案,传递参数为汉字时出现乱码等问题
- 搜索引擎URL中的汉字解析
- 实例解析 Linux系统下U盘汉字乱码问题
- url传值用request.getparameter显示汉字乱码的解决方法
- asp.net url传递后地址栏乱码(中文超过两个汉字)
- url传递汉字乱码解决方案
- HttpURLConnection 返回汉字乱码(全是问号)
- asp.net url传递后地址栏乱码(中文超过两个汉字)
- PHP中get获取url汉字乱码解决办法
- js url传值汉字乱码的问题
- XAMPP Apache服务器解析php页面汉字乱码的解决
- tomcat 在URL中有汉字时乱码解决方法
- URL请求参数使用汉字,产生乱码