Add tests to validate encoding of URLs

Added tests to validate the encoding of returned URL strings
after been escaped or unescaped.
Force encoding before escaping or unescaping

This will reassure not having any errors when escaping or
unescaping.