diff options
author | Robin Jarry <robin@jarry.cc> | 2023-01-26 21:40:38 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-01-28 23:08:11 +0100 |
commit | 9e0f3d1103dc0554086c44f9e86d7b266c97ca66 (patch) | |
tree | 8bbf37cbfd2040f932eaa2ac5240febef723c673 /lib/ui/tab.go | |
parent | 406e4750bd0d8ec756e4b5e28eefc46839a7f230 (diff) | |
download | aerc-9e0f3d1103dc0554086c44f9e86d7b266c97ca66.tar.gz |
wrap: be more robust with locale
On (some?) MacOS systems there is no C.UTF-8 locale available. Instead
there is a non-standard "UTF-8" (encoding only) replacement. Running
wrap on MacOS results in an error:
error: failed to set locale: Bad file descriptor
Instead of expecting that C.UTF-8 will always be available, try to use
the user set locale (either from the $LC_ALL or $LANG environment
variables). If these variables are unset or if they are set to an
invalid/non-existent locale, fallback on C.UTF-8. If C.UTF-8 is not
available, make one last desperate attempt for this UTF-8 non-standard
locale (MacOS only).
aerc will always send UTF-8 encoded text to the filter commands, If the
locale that we managed to load does not use the UTF-8 character
encoding, exit with an explicit error instead of risking undefined
behaviour.
Reported-by: Ben Cohen <ben@bencohen.net>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/ui/tab.go')
0 files changed, 0 insertions, 0 deletions