为什么浏览器以这种形式对 url 进行编码? [英] Why browsers encode url in this form?

查看:27
本文介绍了为什么浏览器以这种形式对 url 进行编码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么浏览器以这种形式对 url 进行编码?

Why browsers encode url in this form ?

来自:

http://www.example.com 

到:

http%3A%2F%2Fwww.example.com

推荐答案

URL 只能使用 ASCII 字符集.

由于 URL 通常包含 ASCII 集之外的字符,因此必须转换 URL.URL 编码将 URL 转换为有效的 ASCII 格式.

Since URLs often contains characters outside the ASCII set, the URL has to be converted. URL encoding converts the URL into a valid ASCII format.

URL 编码将不安全的 ASCII 字符替换为%",后跟与 ISO-8859-1 字符集中的字符值对应的两个十六进制数字.

URL encoding replaces unsafe ASCII characters with "%" followed by two hexadecimal digits corresponding to the character values in the ISO-8859-1 character-set.

网址不能包含空格.URL 编码通常用 + 号替换空格.

URLs cannot contain spaces. URL encoding normally replaces a space with a + sign.

您可以在此处阅读更多信息:

You can read more here:

网址编码/网址编码字符串简介

这篇关于为什么浏览器以这种形式对 url 进行编码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆