URL Encode / Decode URL 编解码
What is URL Encoding?
URL encoding (also called percent-encoding) converts characters that are not allowed in URLs into a safe format. Spaces become %20, Chinese characters and symbols are converted to %XX sequences. It is required when putting user input into query strings, form data, or path segments.
encodeURIComponent vs encodeURI
This tool uses encodeURIComponent / decodeURIComponent, which encode almost all special characters (including &, =, ?, /). Use this when encoding individual query parameters. If you need to encode a full URL while preserving its structure, use encodeURI instead (not provided here).
什么是 URL 编码?
URL 编码(也叫百分号编码)把 URL 中不允许出现的字符转换成安全格式。空格变成 %20,中文和符号变成 %XX 序列。把用户输入放入查询字符串、表单数据或路径时必须使用。
encodeURIComponent 与 encodeURI 的区别
本工具使用 encodeURIComponent / decodeURIComponent,几乎会编码所有特殊字符(包括 &、=、?、/)。适合编码单个查询参数。如果需要编码完整 URL 并保留其结构,应使用 encodeURI(本工具暂不提供)。