minor refactoring

This commit is contained in:
Miroslav Stampar 2010-05-28 14:07:48 +00:00
parent 0f5768cddf
commit accaf0b3bd

View File

@ -95,9 +95,9 @@ def urlencode(string, safe=":/?%&=", convall=False):
return result return result
if convall: if convall:
result = urllib.quote(string.encode("utf-8")) #Reference: http://old.nabble.com/Re:-Problem:-neither-urllib2.quote-nor-urllib.quote-encode-the--unicode-strings-arguments-p19823144.html result = urllib.quote(utf8encode(string)) #Reference: http://old.nabble.com/Re:-Problem:-neither-urllib2.quote-nor-urllib.quote-encode-the--unicode-strings-arguments-p19823144.html
else: else:
result = urllib.quote(string.encode("utf-8"), safe) result = urllib.quote(utf8encode(string), safe)
return result return result