Fixes encodeURI() to comply with RFC 3986 where "[" and "]" are reserved characters.