Better sanitising for URIs

Previous fix escaped only the space, but according to specification much more symbols should be escaped.