mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Teach unquote() to handle unicode inputs
This commit is contained in:
parent
239322b97e
commit
4b0f20def3
2 changed files with 6 additions and 0 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue