URL Encoding Unsafe and Reserved Characters

When using the HTTP interface, HostBridge command strings that include blanks and/or special characters must be URL encoded.

About URL Encoding

Uniform Resource Locators (URLs) are the method used to locate and access information over the Internet. URLs consist of a sequence of characters within the US-ASCII coded character set. URL encoding is a method for representing special characters with a “%” followed by the two hexadecimal digits that form the hexadecimal value of the character within the US-ASCII coded character set.  Safe characters include alphanumerical values [0-9, a-z, A-Z] and certain special characters -_.* (dash, underscore, period and asterisk). These characters can all exist within the URL without encoding because nearly all servers on the Internet will correctly interpret them. Characters that do not have a corresponding graphic character are unsafe, or are reserved for special purposes must be encoded.

  • URLs only use the graphic printable characters of the US-ASCII character set. Thus, characters not used in US-ASCII [80-FF hexadecimal] and control characters [00-1F and 7F hexadecimal] must be encoded.
  • Unsafe characters [<>"#%{}|\^~[]‘] and spaces may not be understood for a number of reasons and must be encoded.
  • Reserved characters [;/?:@=&] have special meanings that define the syntax of the URL. When these reserved characters are used for their special purposes, they can exist without modification
    within the URL. However, when they are used outside their purposes, they must be encoded.

Click here to review different techniques within HostBridge to do URL encoding within an HB.js script. 

The following table gives a list of common characters and their encoding.  Only the characters that are unsafe and may need to be encoded are included.   Unused characters are also not included.





%09Horizontal tab

%0ALine Feed

&0DCarriage Return

!%21Exclamation mark
"%22Quotation mark&quot;
#%23Number sign
$%24Dollar sign
%%25Percent sign
(%28Left parenthesis
)%29Right parenthesis
+%2BPlus sign
/%2FSolidus (slash)
<%3CLess than&lt;
=%3DEquals sign
>%3EGreater than&gt;
?%3FQuestion mark


%40Commercial at
[%5BLeft square bracket
\%5CReverse solidus (backslash)
]%5DRight square bracket


%60Acute accent
{%7BLeft curly brace
|%7CVertical bar
}%7DRight curly brace

A complete list of all characters and their encoding can be found here.