Percent encoding
Escape characters and encoding
You can escape non-alphanumeric characters in your parameter values, using URL percent-encoding conventions.
Values for query parameters that have multiple words can use URL percent-encoded spaces (%20) between the words. For example:
| Character | Escape |
|---|---|
| / | %2F |
| ( | %28 |
| ; | %3B |
| ) | %29 |
&q=lace%20dresses
&fq=color:"light%20blue"
?user_agent=Mozilla%2F5.0+%28compatible%3B+Googlebot%29
Escaping characters for fq and efq
Refer to Faceting and filtering.
The _br_uid_2 cookie is already encoded
Don't encode the cookie parameter value: _br_uid_2. Use this value exactly as it comes. It's already encoded.
&_br_uid_2=uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55
Encoded theme names in thematic page URLs
Here's an example URL: www.example.com/popular/lace-dresses
To send the URL:
- Fetch the value after /popular/ in the URL. That's your theme name. In the example, it's lace-dresses.
- Replace the hyphens with spaces, then apply URL percent-encoding.
- Pass the encoded value in the q parameter as your theme name. In the example, the q parameter value is lace%20dresses.
Encode URL/ref URL
You need to fully encode the url= and ref_url= parameters to prevent breakages on special characters in the URL.
Encoding quick reference
|
Character |
Escape |
|---|---|
| space | %20 |
| ! | %21 |
| " | %22 |
| # | %23 |
| $ | %24 |
| % | %25 |
| & | %26 |
| ' | %27 |
| ( | %28 |
| ) | %29 |
| * | %2A |
| + | %2B |
| , | %2C |
| - | %2D |
| . | %2E |
| / | %2F |
| : | %3A |
| ; | %3B |
| < | %3C |
| = | %3D |
| > | %3E |
| ? | %3F |
| @ | %40 |
| [ | %5B |
| \ | %5C |
| ] | %5D |
| ^ | %5E |
| _ | %5F |
| ` | %60 |
| { | %7B |
| | | %7C |
| } | %7D |
| ~ | %7E |
Updated 11 months ago
