[New-bugs-announce] [issue38056] Add examples for common text encoding Error Handlers

Ma Lin report at bugs.python.org
Sun Sep 8 10:14:30 EDT 2019


New submission from Ma Lin <malincns at 163.com>:

Text descriptions about `Error Handlers` are not very friendly to novices.
https://docs.python.org/3/library/codecs.html#error-handlers

For example:

    'xmlcharrefreplace'
    Replace with the appropriate XML character reference (only for encoding).  Implemented in :func:`xmlcharrefreplace_errors`. 

    'backslashreplace'
    Replace with backslashed escape sequences. Implemented in :func:`backslashreplace_errors`.

    'namereplace'
    Replace with ``\N{...}`` escape sequences (only for encoding).  Implemented in :func:`namereplace_errors`.

Novices may not know what these are.
Giving some examples may help the reader to understand more intuitively.
The effect picture is attached.

I picked two characters:
ß  https://www.compart.com/en/unicode/U+00DFhttps://www.compart.com/en/unicode/U+266C

----------
assignee: docs at python
components: Documentation
files: effect.png
messages: 351329
nosy: Ma Lin, docs at python
priority: normal
severity: normal
status: open
title: Add examples for common text encoding Error Handlers
versions: Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48599/effect.png

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38056>
_______________________________________


More information about the New-bugs-announce mailing list