Fixes UnicodeEncodeError when the URL has non ascii chars

Small fix to parse URLs with diacritics.