mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
![]() On Unix systems a filename can be a sequence of bytes that is not valid UTF-8. Python uses[1] surrogate escapes to allow to decode such filenames to Unicode (bytes that cannot be decoded are replaced by a surrogate; upon encoding the surrogate is converted to the original byte). From `click` docs[2]: > Invalid bytes or surrogate escapes will raise an error when written > to a stream with `errors="strict"`. This will typically happen with > `stdout` when the locale is something like `en_GB.UTF-8`. To fix that, we use `utils.replace_control_chars()` before printing the filenames to `stdout` so that surrogate escapes are replaced by �. Fixes #768 |
||
---|---|---|
.. | ||
gui | ||
isolation_provider | ||
test_docs | ||
test_docs_compressed | ||
test_docs_external | ||
test_docs_large@0068ffcb67 | ||
__init__.py | ||
conftest.py | ||
test_cli.py | ||
test_document.py | ||
test_large_set.py | ||
test_ocr.py | ||
test_settings.py | ||
test_util.py |