URL Encoding Full Guide: encodeURIComponent, Query Threads and Chinese Space
Searching for words with Chinese, re-turning addresses with a URL or connection shows that the parameters obtained by the service are "a little bit less and the spaces change" because the root is often the same. The percentage code is wrong or wrong.。 This Guide compares encodeURIComponent Encoding with the style of the form, describing spaces and +, give the actionable steps, error tables and scenes on the KiloCell page, and indicate when to change to URL or Base64.
The core sentence.
The first step is to identify how the "whole URL" and "polymetrical value" should be coded. The word Chinese and the word reservation must be replaced by by the word bytes %HH。
The URL code on Web is officially coded as a percentage number. The goal is to keep URI only using a secure ASCII subset without destroying it. ? & = # . The syntax character of the structure character. Main tool:URL encoding。
Why do you have to encode?
In URI syntax, some characters have special meanings:
| Character | Common role | If "ordinary content" is not encoded |
|---|---|---|
? |
Query string start | The back is used as the parameter area. |
& |
Parameter Separating | One value is split into two parameters |
= |
Key Separator | Value is cut |
# |
Snippets begin. | The service might not get behind it. |
| spaces | No nakedness. | Rejected or modified by different clients +/%20 |
| ASCII Chinese and other | Non URI Literal | You have to press UTF-8 first. % Coding |
Therefore:(a) The word retention in the parameter value should be coded; It's for "structure." ? & Do not go to the entire double-coding as part of the value. The wrong level of coding is the first major pit coordinated.
encodeURIComponent vs encodeURI
Browsers do not have the same meaning as the sets of names that are common to the norms.
| Name / API | spaces | Yeah. / ? & = Wait. |
Typical uses |
|---|---|---|---|
encodeURIComponent |
%20 |
Mostly coded. | SingleQuery values, path sections, table field values |
encodeURI |
%20 |
Keep URI structure characters as much as possible | Full URL, only when processing unsafe characters (use caution) |
application/x-www-form-urlencoded |
Always. + |
Approaching Component Rules | HTML Form GET/ POST Body |
| The "Talk to Chinese" of the Chinese only. | No, no, no. | Frequently missing symbols | Easily intermittent bug, to be discarded |
Use "Entent Encoding Now" on KiloCell of pages encodeURIComponent。 Use "Cod immediately" decodeURIComponent, and will put first + Replace with spaces to fit in the form style +。
Meaning:
- You want the coded one? A parameter value(in Chinese, spaces, spaces,
&) Encoding with this tool (component syntax) is right. - You have complete hands.
https://...?..., just "see the parameters" and use the bottom. URL Parameter Parsingand URL Parsing, do not reset the entire URLencodeURIComponentOnce and for all, unless you're gonna think of it as Value of another parameter(e.g.,redirect=)。 - Service parsing by Form Rule and Space is
+• Decoding side-book tools are compatible; Encoding Side Forced by Peer+, need to know with%20The difference was partly rigorously verified.
Chinese vs. Space
Take UTF-8, for example, "you" bytes E4 BD A0 → %E4%BD%A0。
| Original | Component Encoding (this tool) | Common in form queries |
|---|---|---|
hello world |
hello%20world |
hello+world Or the same. %20 |
R&B |
R%26B |
Same Left (Land)& (Cluster must) |
a=b |
a%3Db |
Same Left |
Chinese |
%E4%B8%AD%E6%96%87 |
Same left (UTF-8 percentage) |
What do you do on the 1,000?
tools page:URL encoding。
- Open the page. Enter /tools/dev/url-encoderYes, I see it. Enter content (Input) and Process result (Output)。
- Paste text. This can be a nudity parameter value, a query string, or a complete URL.
- Encoding. Points Encoding Now → Output as
encodeURIComponentResult。 - Decoding. Points Decoding now • Output as decoded text; Ham
+. The search string is to be used as a space before the puzzle is solved. - Real time processing. Check Real time processing(Default check) Enter changes automatically: if content is coded (incl.)
%(c) Decoded or otherwise coded; and triggers the parameter resolution. Please, if you're not sure. Manual Point Encoding/Decoding, avoid automatic tactics contrary to expectations. - Look at the query parameters. Below URL Parameter Parsing (Query Parameters) ♪ Will try from ♪
?Later or "Query-like"key=value*Stick-out key pair. Full URL structure (agreements, hosts, paths) is more appropriate URL Parsing Tool。 - Copy。 CopyResult Writes the output to the clipboard. Top Left Clear Clear the input.
Capacity boundaries
- Do: Codec, code for the computer level
+When space decodes, easy query splits, local processing. - Do not: How many layers of the code will you judge your business? Do not achieve all historical character sets (e.g., a new match for a pure GBK site).
- Privacy: Logical in browsers; Do not display the URL of Token on the screen for long periods.
Common error and contrast
| phenomena | Common causes | Processing |
|---|---|---|
| Service-end parameters are cut | Value & # Unencoded |
Yeah. Value Component Encoding |
Chinese to ???? Or a glitch. |
One end non-UTF-8; Or decode it once, but it's coded on two levels. | UTF-8 harmonization; Layers decomposition and record layers |
Space becomes + I don't know. |
Form + vs %20 |
This tool decoded has been replaced +; Encode Output As %20, with the peer |
| Unable to open the entire URL code | And the structure characters are encoded. | Encoding only the part (e. g. redirect) that should be embedded |
Decoding error URI malformed |
% The post-Sixteens are not two hexadecimals. Disable. %E4 |
Complete or repair the source; Don't decode the usual. |
Double Encoding %2520 |
Encoded Again | Decoding to see if it is restored at once; The chain is only one. |
| Signing verification failed | The original signature is not consistent with the coded string | First, make sure the signature is "pre-coding or pre-coding." |
| Parameter Parsing Area is empty | No, I'm not. ? Not really. a=b Form |
Complete query or change to URL parsing tool to see structure |
Suggested order of reference
- The question is whether the whole URL or the "a certain value" is a problem.
- The actual line example of spaces is
+Or is it?%20。 - There are several layers of code.
%25)。 - The back-end frame is decoded several times (some containers automatically decoded).
Real work scenarios
Scene A: Search and Filter
User Search C++ & 教Cheng。 If not, then, it's not.& Cuts out the parameters. Put keywords in a tool point alone Encoding NowScroll it again. ?q=。 Revert with decoded to confirm consistency with the product.
scene B:OAuth / Payback redirect_uri
The outer layer is the certified URL and the inner layer is also the URL itself. The right thing to do is to call back the address as A parameter value Overall encodeURIComponent, and not just Chinese. Encoding "Return naked URL" with this tool, then checking for only one parameter by parseing it to the outer layer redirect_uri key.
C: Request line in the log
Gateway access log query encoded. Check out the business issues, put ? Post-full input, point Decoding now or rely on real-time processing, which is then itemized in the parameter list. If only host/path, turn URL Parsing。
Scenario D: Place binary token in Quary
Someone first Base64 and then put the URL. Base64 + / Queary conflict. The order should be: Base64 (or directly Base64URL) and URL code; Or change the Header pass. Base64. Base64 tools, URL layer uses this tool.
Scene E: Back and forth, "I don't have a code. I'm coded."
Agreed test vector: specified a b、Chinese、x=y&z。 Both parties code the same vector in this tool, contrasting the primary gateway query. Post the tool output into the sheet, which is more recapable than the screenshot browser address bar (note that the address bar may display decodeable reading forms twice).
scene F: Clickable links in mail or document
Document authors often change Chinese manually, resulting in semi-encoding. Read the readability by decoded before posting and recode the pasteable ASCII link to avoid some client not being able to open it.
List of practices
- Encoding to Value Or is it? Full URL, write to the interface document.
- (a) Uniting UTF-8; The government has been able to provide a full-time and independent response to the issue.
- A time-series chart of the signature/checking original and encoded steps.
- Automatic Real time processing When you conflict with a manual button, you will make the key conclusion manually.
- The URL with Token is not to be published, Issue; . You can empty your tool.
- The data that is sensitive to the Header/Body is released less query (the log is easier to leak).
- Encoding URL numbers: whenever values are embedded, the code is coded once.
FAQ
Is the space `%20 ' or `+ '?
Yes. application/x-www-form-urlencoded The lispace is coded as +; ♪ On the path with ♪ encodeURIComponent And in it, %20。 This tool encodes the output %20Decoded to accept +。 When you're not aligned with the back end, you have to match a true request, not with memory.
Why would I need to code twice?
When the URL is itself a value of another URL, the inner URL is written first and then encoded once (outside). It's not bug. If business doesn't have a nest, it's happening. %252F This type, mostly intermediate duplicates, should be repaired.
How is `encodeURI ' different from this tool?
encodeURI I'll keep it. ? & The only thing that suits us is the "basically URL, dealing only with non-ASCII" situations. This tool goes. encodeURIComponent, more suitable for parameter values. Encoding Full URL string to pass when parameters are passed It's the right tool to use.
Is the decode failed?
Usually, it's illegal to enter. % Sequence or bytes missing. Check first for copying cut-off; It's not normal to decode an explicit error. The sample is scaled to a minimum recalcitrant.
What difference does it make between parameter resolution and "code"?
Decoding Restore %HH (a) as a character; Parameter Parsing by key=value Cut. You can decode the whole text or read every value after it is deciphered. Parsing Dependencies URLSearchParams Rule, extreme custom separator may not be compatible.
Will online tools pass my URL?
Thousands of cells for the page are processed locally in the browser. However, URLs may contain session parameters: screen sharing, browser plugins and "copy to chat" are still leaking channels. Production barriers are prioritized for dissensitization or use of test environment links.
Parameter audit before sending
The code is completed and the parameter name, parameter values and signature order are checked. If the link is used for burying points or backsliding, it is recommended that the original value, the code value and the final complete URL be kept in three columns, with a dissensitized sample, confirming that decoded is consistent with business input. Do not use passwords, session Token or ID numbers as normal parameters in URLs for long periods, as they may be retained in browser history, Referer, proxy logs and intercepts. When sensitive data need to be transmitted, priority is given to HTTPS requests and service-end verification of source, expiry time and re-entry risks.
Continue reading
Use R&B Chinese A code is performed, the original text is decoded and the most common pit can be covered by observing the split of the full test URL in the parameter resolution area.