utils.rfc6266: Remove percent_decode function.

This commit is contained in:
Florian Bruhin 2014-08-14 11:59:23 +02:00
parent 9ae5a90f5e
commit 33b1cc6916

View File

@ -79,14 +79,6 @@ class ContentDisposition:
return 'ContentDisposition(%r, %r, %r)' % (
self.disposition, self.assocs, self.location)
def percent_decode(string, encoding):
# unquote doesn't default to strict, fix that
return urllib.parse.unquote(string, encoding, errors='strict')
def fits_inside_codec(text, codec):
try:
text.encode(codec)
@ -147,7 +139,7 @@ def parse_ext_value(val):
else:
charset, coded = val
langtag = None
decoded = percent_decode(coded, encoding=charset)
decoded = urllib.parse.unquote(coded, charset, errors='strict')
return LangTagged(decoded, langtag)
# RFC 2616