Fixes UnicodeEncodeError when the URL has non ascii chars