MCPcopy Index your code
hub / github.com/RustPython/RustPython / unquote

Function unquote

Lib/urllib/parse.py:716–736  ·  view source on GitHub ↗

Replace %xx escapes by their single-character equivalent. The optional encoding and errors parameters specify how to decode percent-encoded sequences into Unicode characters, as accepted by the bytes.decode() method. By default, percent-encoded sequences are decoded with UTF-8, and i

(string, encoding='utf-8', errors='replace')

Source from the content-addressed store, hash-verified

714 yield string[previous_match_end:] # Non-ASCII tail
715
716def unquote(string, encoding='utf-8', errors='replace'):
717 """Replace %xx escapes by their single-character equivalent. The optional
718 encoding and errors parameters specify how to decode percent-encoded
719 sequences into Unicode characters, as accepted by the bytes.decode()
720 method.
721 By default, percent-encoded sequences are decoded with UTF-8, and invalid
722 sequences are replaced by a placeholder character.
723
724 unquote('abc%20def') -> 'abc def'.
725 """
726 if isinstance(string, bytes):
727 return _unquote_impl(string).decode(encoding, errors)
728 if '%' not in string:
729 # Is it a string-like object?
730 string.split
731 return string
732 if encoding is None:
733 encoding = 'utf-8'
734 if errors is None:
735 errors = 'replace'
736 return ''.join(_generate_unquoted_parts(string, encoding, errors))
737
738
739def parse_qs(qs, keep_blank_values=False, strict_parsing=False,

Callers 5

_parseMethod · 0.90
proxy_openMethod · 0.90
ftp_openMethod · 0.90
url2pathnameFunction · 0.90
unquote_plusFunction · 0.70

Calls 5

isinstanceFunction · 0.85
_unquote_implFunction · 0.85
_generate_unquoted_partsFunction · 0.85
decodeMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected