Possible locale issue: jc -a and jc -v don't work when LANG=C on Debian Buster
See original GitHub issueI’ve installed the latest version of jc
using the deb on Debian Buster using this Ansible role:
which jc
/usr/local/bin/jc
dpkg -L jc
/.
/usr
/usr/local
/usr/local/bin
/usr/local/bin/jc
/usr/share
/usr/share/man
/usr/share/man/man1
/usr/share/man/man1/jc.1
/usr/share/doc
/usr/share/doc/jc
/usr/share/doc/jc/changelog.gz
zgrep jc /usr/share/doc/jc/changelog.gz
jc (1.18.6-1) whatever; urgency=medium
And things like jc ls
work without an issue, but jc -a
doesn’t when LANG=C
:
export LANG=C && jc -a
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "jc.cli", line 417, in main
UnicodeEncodeError: 'ascii' codec can't encode character '\xa9' in position 366: ordinal not in range(128)
Nor does jc -v
:
export LANG=C && jc -v
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "jc.cli", line 429, in main
UnicodeEncodeError: 'ascii' codec can't encode character '\xa9' in position 55: ordinal not in range(128)
With LANG=en_GB.UTF-8
there isn’t a problem:
export LANG=en_GB.UTF-8 && jc -v
jc version 1.18.6
https://github.com/kellyjonbrazil/jc
© 2019-2022 Kelly Brazil
This isn’t the behaviour expected based on the documentation, could it be something odd with my setup? I have tested this locally and on a remove development server both as a regular user and as root
and the results are consistent.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Locale - Debian Wiki
Run the command locale -a to verify the list of available locales; note that the spellings change. If you've upgraded to Lenny and...
Read more >Problem of Can't set locale; make sure $LC_* and $LANG are ...
Debian ships locales in source form. They need to be compiled explicitly. The reason for this is that compiled locales use a lot...
Read more >How to install/change locale on Debian? - Server Fault
I remember that setting LC_ALL on my Ubuntu desktop system works fine. Do I need to install extra packages to make this work,...
Read more >How do I fix my locale issue? - Ask Ubuntu
First run locale to list what locales currently defined for the current user account: $ locale LANG=C LANGUAGE= LC_CTYPE=fi_FI.
Read more >Installing Home Assistant Supervised on Debian 11
Using Debian 11 and following a strict set of guidelines available HERE will give you an officially supported installation of Home Assistant ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
cool, making some final touches and will release as v1.18.8 in the next day or so.
Think I have this working in
master
now. The best way to test would be to clone themaster
branch and pip install from there. The behavior is pretty inconsistent, at least in my testing. Sometimes I can get the copyright character to generate the exception, and other times (say when inserting the copyright character into ak/v
orcsv
parser input) no exception is generated and the character prints just fine with C locale. Strange.