GUIDE深度 · Deep dive
URL Encoding Basics
URL encoding turns unsafe characters into % plus two hex digits. Non-ASCII characters are first converted to UTF-8 bytes, then each byte is encoded; one Chinese character usually becomes three %XX sequences.
What to encode
Spaces, Chinese, quotes, angle brackets, #, %, & and more.
Reserved characters stay unencoded only when used as structure.
Common errors
Double encoding: %20 becomes %2520.
Treating + as a space; use %20 in paths.
Decoding malformed % sequences throws.
FAQ
How many bytes is one Chinese character?
Usually three UTF-8 bytes, so three %XX sequences (nine characters).
Should / be encoded?
Not as a path separator; yes when it is part of a value.
Sources
Related calculators
URL Encoder/DecoderPercent-encode or decode a full URL or a parameter value with UTF-8 support.More guides
encodeURI vs encodeURIComponentRead guideKEEP READING
继续读
按顺序读,或跳到同主题的其他指南。