Teach unquote() to handle unicode inputs

This commit is contained in:
Raymond Hettinger 2005-10-15 16:41:53 +00:00
parent 239322b97e
commit 4b0f20def3
2 changed files with 6 additions and 0 deletions

View file

@ -1061,6 +1061,8 @@ def unquote(s):
res[i] = _hextochr[item[:2]] + item[2:]
except KeyError:
res[i] = '%' + item
except UnicodeDecodeError:
res[i] = unichr(int(item[:2], 16)) + item[2:]
return "".join(res)
def unquote_plus(s):