diff --git a/Doc/library/urllib.parse.rst b/Doc/library/urllib.parse.rst index 9a8f8cf9bab012e..031295c34105a00 100644 --- a/Doc/library/urllib.parse.rst +++ b/Doc/library/urllib.parse.rst @@ -748,7 +748,7 @@ task isn't already covered by the URL parsing functions above. *encoding* defaults to ``'utf-8'``. *errors* defaults to ``'replace'``, meaning invalid sequences are replaced - by a placeholder character. + by ``�`` (U+FFFD, the official REPLACEMENT CHARACTER). Example: ``unquote('/El%20Ni%C3%B1o/')`` yields ``'/El Niño/'``. diff --git a/Lib/urllib/parse.py b/Lib/urllib/parse.py index f6c94060054e48f..ef2b47c8a7b8ec9 100644 --- a/Lib/urllib/parse.py +++ b/Lib/urllib/parse.py @@ -861,7 +861,7 @@ def unquote(string, encoding='utf-8', errors='replace'): sequences into Unicode characters, as accepted by the bytes.decode() method. By default, percent-encoded sequences are decoded with UTF-8, and invalid - sequences are replaced by a placeholder character. + sequences are replaced by U+FFFD (REPLACEMENT CHARACTER). unquote('abc%20def') -> 'abc def'. """