Percent encoding - Bloomreach Experience - Open Source CMS

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 and fq parameter values with %20 encoding

&q=lace%20dresses

&fq=color:"light%20blue"


Here's another example, this time with several different escape characters for the  user_agent  parameter:

user_agent parameter value with multiple escape characters

?user_agent=Mozilla%2F5.0+%28compatible%3B+Googlebot%29

The values for some parameters, such as fq, require double quote marks ( " ) around them. If the value you're specifying includes double quotes, then you need to escape those double quotes with a backslash ( \ ) before the value's double quotes. For example:

Escape double quotes

&fq=size:"8.5\" by 11\" "

 

The cookie is already encoded

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

How do you send URLs with percent-encoded theme names?

Here's an example URL: www.example.com/popular/lace-dresses

  1. Fetch the value after /popular/ in the URL. That's your theme name. In the example, it's lace-dresses.
  2. Replace the hyphens with spaces, then apply URL percent-encoding.
  3. 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
Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?