According to the ECMA standard (edition 3), a URI is composed of component parts separated by special characters. The special characters are:
Other characters are reserved for future use.
A URI will need to be encoded without damaging these characters. Normal escape() function techniques are not URI safe.
ECMA defines functions for encoding and decoding the entire URI and also functions for dealing with its components individually.