1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-26 07:53:58 +00:00

Merge pull request #7315 from ThomasWaldmann/pythonioencoding

document another way to get UTF-8 encoding on stdin/stdout/stderr, fixes #2273
This commit is contained in:
TW 2023-02-02 00:35:21 +01:00 committed by GitHub
commit f25f6a8e33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,9 +18,6 @@ Important: JSON output is expected to be UTF-8, but currently borg depends on th
for that (must be a UTF-8 locale and *not* "C" or "ascii"), so that Python will choose to encode to UTF-8. for that (must be a UTF-8 locale and *not* "C" or "ascii"), so that Python will choose to encode to UTF-8.
The same applies to any inputs read by borg, they are expected to be UTF-8 encoded also. The same applies to any inputs read by borg, they are expected to be UTF-8 encoded also.
We consider this a bug (see :issue:`2273`) and might fix it later, so borg will use UTF-8 independent of
the locale.
On POSIX systems, you can usually set environment vars to choose a UTF-8 locale: On POSIX systems, you can usually set environment vars to choose a UTF-8 locale:
:: ::
@ -29,6 +26,17 @@ On POSIX systems, you can usually set environment vars to choose a UTF-8 locale:
export LC_CTYPE=en_US.UTF-8 export LC_CTYPE=en_US.UTF-8
Another way to get Python's stdin/stdout/stderr streams to use UTF-8 encoding (without having
a UTF-8 locale / LANG / LC_CTYPE) is:
::
export PYTHONIOENCODING=utf-8
See :issue:`2273` for more details.
Dealing with non-unicode byte sequences and JSON limitations Dealing with non-unicode byte sequences and JSON limitations
------------------------------------------------------------ ------------------------------------------------------------