summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaz Solc <tomaz.solc@tablix.org>2021-01-08 15:49:43 +0100
committerTomaz Solc <tomaz.solc@tablix.org>2021-01-08 15:49:43 +0100
commit21f7afdc8eac97c4279501306adf8b3f0ece4e40 (patch)
tree78cbb2f661d85783c493a1882b0470227b76e1a4
parentc42c39d0f128c7e495b38deed0364da2fba48402 (diff)
downloadunidecode-21f7afdc8eac97c4279501306adf8b3f0ece4e40.tar.gz
Add examples for the 'errors' argument.
-rw-r--r--README.rst9
1 files changed, 8 insertions, 1 deletions
diff --git a/README.rst b/README.rst
index 6774ed4..2537064 100644
--- a/README.rst
+++ b/README.rst
@@ -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::