URL 编码
来源:互联网 发布:mac有迅雷吗 编辑:程序博客网 时间:2024/05/22 05:23
URL 编码
URL 只能使用 ASCII 字符集来通过因特网进行发送。
由于 URL 常常会包含 ASCII 集合之外的字符,URL 必须转换为有效的 ASCII 格式。
URL 编码使用 “%” 其后跟随两位的十六进制数来替换非 ASCII 字符。
URL 不能包含空格。URL 编码通常使用 + 或者 %20 来替换空格。
URL 编码函数
JavaScript、PHP、ASP 都提供了对字符串进行 URL 编码的函数。
JavaScript 中使用 encodeURI() 函数,PHP 中使用 rawurlencode() 函数,ASP 中使用 Server.URLEncode() 函数。
JavaScript 转码代码
<html><head><script type="text/javascript"> function encode(){ document.getElementById("outputID").value = encodeURI(document.getElementById("inputID").value); }</script></head><body>转码前:<input type="text" id="inputID" style="height:50px;width:1000px"/><br/><br/>转码后:<input type="text" id="outputID" style="height:50px;width:1000px"/><br/><br/><Button onclick = "encode()" style="margin-left:200px;height:50px;width:500px;font-size:20px;font-weight:900">转码开始</Button></body></html>
0 0
- url编码
- URL编码
- URL编码
- URL编码
- url 编码
- URL编码
- URL编码
- URL编码
- Url编码
- URL编码
- URL编码
- URL编码
- URL编码
- url编码
- url编码
- URL编码
- url编码
- url编码
- shell脚本的一些基础知识
- ADB使用方法及常用命令
- android自定义style
- OpenCV中mat的type
- 完美解决!隐藏listview的headerView,实现动态下拉,(仿ios)
- URL 编码
- Android开发-仿支付宝支付密码EditText实现
- Android混淆
- content delivery network
- Android Studio你不知道的调试技巧
- QT平台连接MySQL数据库
- 15个顶级Java多线程面试题及回答
- Android之JAVASe基础篇-面向对象-多线程(七)
- 撞死