recentpopularlog in

kme : locale   25

maint: skip a check when en_US.UTF-8 collation rules are broken
On OS X, *.UTF-8 locales use ASCII collating rules(!?):
<code class="language-bash">readlink /usr/share/locale/*.UTF-8/LC_COLLATE|sort -u
# result: ../la_LN.US-ASCII/LC_COLLATE</code>

This means that sort, and any other program that relies on strcoll,
cannot be expected to work consistently on OS X in any UTF-8 locale.
sorting  collation  i18n  locale  lc_all  macos  elcapitan  brokenness 
12 weeks ago by kme
Issue 23195: Sorting with locale (strxfrm) does not work properly with Python3 on BSD or OS X - Python tracker
What is 'ln_LA' anyway?
The initial difference appears to be a long-standing BSD (including OS X) versus GNU/Linux platform difference. See, for example:

Why there is no difference between en and fr UTF-8 is obvious when you look under the covers at the system locale definitions. This is on FreeBSD 10, OS X 10.10 is the same:

$ cd /usr/share/locale/fr_FR.UTF-8/
$ ls -l
total 8
lrwxr-xr-x 1 root wheel 28 Jan 16 2014 LC_COLLATE -> ../la_LN.US-ASCII/LC_COLLATE
lrwxr-xr-x 1 root wheel 17 Jan 16 2014 LC_CTYPE -> ../UTF-8/LC_CTYPE
lrwxr-xr-x 1 root wheel 30 Jan 16 2014 LC_MESSAGES -> ../fr_FR.ISO8859-1/LC_MESSAGES
-r--r--r-- 1 root wheel 36 Jan 16 2014 LC_MONETARY
lrwxr-xr-x 1 root wheel 29 Jan 16 2014 LC_NUMERIC -> ../fr_FR.ISO8859-1/LC_NUMERIC
-r--r--r-- 1 root wheel 364 Jan 16 2014 LC_TIME

For some reason US-ASCII is used for UTF-8 collation; this is also true for en_US.UTF-8 and de_DE.UTF-8, the only other ones I checked.

The postresq discussion and some earlier Python issues suggest using ICU to properly implement Unicode functions like collation across all platforms. But that has never been implemented in Python. Nosing Marc-Andre.
python  sorting  locale  collation  strings  macos  elcapitan  brokenness 
12 weeks ago by kme
Docker and Locales
Like, in my case, Vim wasn't displaying UTF-8 encoded symbols (like "»") correctly.

Here's his working Dockerfile recipe:
<code>FROM ubuntu:13.10

# Set the locale
RUN locale-gen en_US.UTF-8
docker  locale  characterencoding  errormessage  annoyance  solution 
june 2019 by kme
yum - How to add language support on CentOS 7 (on Docker)? - Server Fault
If they'd just stop saying 'localectl' is the solution, when it doesn't work in Docker. There's no DBus daemon running or something. The 'systemctl' command doesn't work, even. These things are stripped out in container environments, I guess.

What *actually* works is
<code class="language-bash">yum reinstall -y glibc-common</code>
and then setting 'LC_ALL` or 'LANG` in the environment.
centos  centos7  locale  docker  language  characterencoding  maybesolution 
june 2019 by kme
How to Set Up System Locale on CentOS 7 | RoseHosting
I think 'localectl' is not built into the base CentOS 7 OS or something? Or at least not the Docker image? Because, sure enough, it wasn't there before, and after a 'yum update' it is.

For a CentOS 7 Docker image, however, you still need to 'yum reinstall -y glibc-common' and just set 'LC_ALL' or 'LANG' in your environment; the 'localectl' command won't work because there's no D-Bus daemon running on the Docker image.
centos  locale  language  sysadmin  sortof  solution  docker 
june 2019 by kme
windows - How to fix PuTTY showing garbled characters? - Server Fault
The analogous fix on CentOS (7) is to use 'localectl', maybe, except that requires DBus to be running, which it isn't for a fresh-out-of-the-box Docker container. ¯\_(ツ)_/¯
If the locale returns something like POSIX, issue
<code class="language-bash">update-locale LANG=en_US.utf8</code>
at the command line - see – koppor Dec 19 '15 at 11:05
docker  utf8  characterencoding  locale  mojibake  terminal  unix  shell  ubuntu  solution  centos  sortof 
june 2019 by kme
centos5 - How do I change my locale to UTF-8 in CentOS? - Server Fault |
In CentOS try with system-config-language command. That's the CentOS way :) Also you can try with:
<code class="language-bash">
localedef -c -f UTF-8 -i de_DE de_DE.UTF-8
export LC_ALL=de_DE.UTF-8</code>
locale  centos  aufdeutsch  language  i18n  solution 
may 2018 by kme
set locale on commandline without system-config-language - CentOS |
So... there is basically no good solution for this out of the box? A CentOS 7 Docker container has the same problem.

<code class="language-bash">yum whatprovides \*/setlocale</code>
centos  language  locale  i18n  interesting  sysadmin 
may 2018 by kme
open source - Gnome DIA change User Interface Language - Stack Overflow
Setting LANG=en_EN in the login environment might work, but on a Mac you can hard-code this into '/Applications/' around line 137.
dia  environmentvariable  environment  language  locale  solution 
october 2016 by kme
python - UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 1 - Stack Overflow
If you are working on a remote host, look at /etc/ssh/ssh_config on your local PC.

When this file contains a line:

SendEnv LANG LC_*

comment it out with adding # at the head of line. It might help.

With this line, ssh sends language related environment variables of your PC to the remote host. It causes a lot of problems.

No problems with my terminal. The above answers helped me looking in the right directions but it didn't work for me until I added 'ignore':

fix_encoding = lambda s: s.decode('utf8', 'ignore')

As indicated in the comment below, this may lead to undesired results. OTOH it also may just do the trick well enough to get things working.
locale  utf8  annoyance  headache  encoding  ssh  python  webdevel  fuckina  solution 
june 2016 by kme
Quick Locale Switcher :: Add-ons for Firefox
Used to be a very good and almost essential add-on... However, it seems that the developers turned it into an adware / spyware during March, 2013. Developer's site (ppclick) seems to be a scam or ad-site as well – when it is working. The site has always been an advertiser one according to the archives. It is recommended to stay away from this add-on and the developer's website as well. Beware and do not install, but rather tweak and update some (clean) old version of the add-on for yourself.
malware  language  firefox  addon  extension  locale 
april 2016 by kme
Locales unter Ubuntu konfigurieren – Thomas-Krenn-Wiki
This fixes the problem (with PuTTY, anyway) of Unicode linedraw characters just *refusing* to draw, regardless of font, TERM, or NCURSES_NO_UTF8_ACS=1 being set in the environment.
# update-locale LANG=de_DE.UTF-8
putty  ubuntu  debian  locale  linedrawcharacters  unicode  solution 
february 2016 by kme
windows - How to fix PuTTY showing garbled characters? - Server Fault
None of the obvious solutions worked (choose a different font, set the TERM type in the PuTTY settings), but running 'update-locale' *did*:

This is not sufficient in all cases. You should also export the following variable to your environment: NCURSES_NO_UTF8_ACS=1 [more info] – Piotr Jurkiewicz Dec 14 '14 at 22:53

in case locale returns POSIX you probably have usePAM disabled in the sshd config – user2693017 Jul 20 '15 at 19:59

If the locale returns something like POSIX, issue update-locale LANG=en_US.utf8 at the command line - see – koppor Dec 19 '15 at 11:05
putty  linedrawcharacters  locale  annoyance  terminal  configsetting  solution 
february 2016 by kme
Php get list of locales installed on system
On linux , the list of locales installed on the system can be fetched through the terminal command locale -a :
locale  i18n  unix  linux  console  encodings  solution 
july 2015 by kme

Copy this bookmark:

to read