- To encode url/uri text enter it in Decoded textbox and encoded value will appear in other textbox.
- To decode url/uri text enter it in Encoded textbox and the decoded value will appear in other textbox.
Some points to note:
- The javascript methods encodeURIComponent and decodeURIComponent are being used to encode and decode with special handling for space as mentioned below
- Space is being encoded as '+' and Similarly + is being decoded as space
- encodeURIComponent escapes all characters except the following: alphabetic, decimal digits, - _ . ! ~ * ' ( ). For reference see mozilla doc for encodeURIComponent
- encodeURIComponent (and not encodeURI) should be used for user entered data which needs to be passed as part of URI