diff options
author | Tomaz Solc <tomaz.solc@tablix.org> | 2021-01-08 15:49:43 +0100 |
---|---|---|
committer | Tomaz Solc <tomaz.solc@tablix.org> | 2021-01-08 15:49:43 +0100 |
commit | 21f7afdc8eac97c4279501306adf8b3f0ece4e40 (patch) | |
tree | 78cbb2f661d85783c493a1882b0470227b76e1a4 | |
parent | c42c39d0f128c7e495b38deed0364da2fba48402 (diff) | |
download | unidecode-21f7afdc8eac97c4279501306adf8b3f0ece4e40.tar.gz |
Add examples for the 'errors' argument.
-rw-r--r-- | README.rst | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -73,7 +73,14 @@ can be used to find the offending character. ``'replace'`` will replace them with ``'?'`` (or another string, specified in the *replace_str* argument). ``'preserve'`` will keep the original, non-ASCII character in the string. Note that if ``'preserve'`` is used the string returned by ``unidecode()`` will not -be ASCII-encodable! +be ASCII-encodable!:: + + >>> unidecode('\ue000') # unidecode does not have replacements for Private Use Area characters + '' + >>> unidecode('\ue000', errors='strict') + Traceback (most recent call last): + ... + unidecode.UnidecodeError: no replacement found for character '\ue000' in position 0 A utility is also included that allows you to transliterate text from the command line in several ways. Reading from standard input:: |