Prevented UnicodeEncodeError at urlencode