Friday, September 11, 2009

Special characters (#, @, :) in URL

Special characters (#,@,:) in URLs

Special characters as #,@,: in URLs have to be hex encoded.

Example: Your password is ###
It gets encoded to ftp://user:%23%23%23@host.com
where 23 is the hex value (0x23) of '#'

Character Hex Conversion

#%23
space%20
@%40

Unsafe characters :
Why: Some characters present the possibility of being misunderstood within URLs for various reasons. These characters should also always be encoded.
Characters:

Character CodePoints(Hex) CodePoints(Dec)
Space 20 32
Quotation marks 22 34
'Less Than' symbol("<") 3C 60
'Greater Than' symbol (">") 3E 62
'Pound' character ("#") 23 35
Percent character ("%") 25 37

Left Curly Brace ("{") 7B 123
Right Curly Brace ("}") 7D 125
Vertical Bar/Pipe ("|") 7C 124
Backslash ("\") 5C 92
Caret ("^") 5E 94
Tilde ("~") 7E 126
Left Square Bracket ("[") 5B 91
Right Square Bracket ("]") 5D 93
Grave Accent ("`") 60 96

No comments: