URL 编码解码器
URL 编码百分号转义:encodeComponent 与完整 URL 双模式、多轮解码容错、坏 % 定位。浏览器本地运行,无上传。
Mode
Action
Component vs full URL
“Component” percent-encodes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ) — correct for individual values such as q=hello world. “Full URL” keeps structural characters (/ ? # & = : @ , ;) intact so a whole URL remains navigable. Decoding tries decodeURIComponent first, then falls back to lenient decodeURI; a malformed % sequence is reported with its exact position.
如何使用URL 编码解码器
粘贴文本或完整 URL,先选择模式再动手:编码组件模式会连带斜杠、问号、& 一起转义,适合放单个参数值;完整 URL 模式保留结构,分隔符原样存活。解码实时进行,多层编码就多轮循环,坏掉一个 % 也会精确定位。
%20 与加号的历史在这里一目了然——百分号编码是标准,加号属于表单时代。解码结果乱成天书通常只有两种可能:编码了两次,或者把组件当完整 URL 编了。工具让这两种错误当场现形。