6
votes
Accepted
Why is ls sorting Chinese filenames by length?
You'll notice that among the strings of same length, there appears to be a relative order of those characters, so they're not totally treated as being equivalent. It's not like the 🧚🧛🧜 which have ...
6
votes
How to get the current value of LC_CTYPE etc. in Bash?
Assuming evaluating the output of locale is safe (we assume that locale is not a shell function, alias, or other non-standard utility):
(eval "$(locale)" && printf '%s\n' "$...
5
votes
Accepted
apt randomly switches languages ever since I installed Arabic on my Pop!_OS running KDE Plasma
The LANGUAGE environment variable is specific to GNU gettext (and therefore influences the programs using gettext as a way to ease their internationalization)
You define LANGUAGE=en_US:en_US:en_US:ar
...
3
votes
Accepted
Cannot set LC_* to default locale: No such file or directory
Considering the very last line of my question (Thanks Chris Davies for the pointer):
/usr/sbin/dpkg-reconfigure: locales is not installed
It was easy just to install the locales package, which I ...
3
votes
How to preserve non-ASCII characters?
that's not happening on the server; the displaying of characters is done locally by your terminal emulator. So you need a terminal that cleanly deals with these characters. Should pretty much be UTF-8 ...
2
votes
Why is ls sorting Chinese filenames by length?
I found out where macOS stores locale files, in /usr/share/locale, and to my surprise this is how the zh_CN.UTF-8 locale is defined:
% ls -la /usr/share/locale/zh_CN.UTF-8
total 8
drwxr-xr-x 8 root ...
2
votes
Accepted
How to get the current value of LC_CTYPE etc. in Bash?
According to man locale the value of LC_CTYPE being enclosed in double quotes signifies it's an "implied value":
Values for variables set in the environment are printed without
double ...
1
vote
Accepted
How to unset a locale variable using localectl?
localectl can’t unset a locale variable directly, however it does simplify locale variable assignments, clearing LC_ variables whose value equals that of LANG. So you can clear LC_TIME by setting it ...
1
vote
LC_TIME portability (and other locale settings)
The short answer: Yes. POSIX and Unicode CLDR.
The longer version:
If we look at the FreeBSD Developer Handbook Chapter 4. Localization and Internationalization - L10N and I18N it tells us FreeBSD ...
1
vote
Accepted
How to fix a locale warning from Perl?
The problem comes from
LC_MEASUREMENT=Default.UTF-8
You need to find where that’s set and correct it. It could be somewhere in /etc or in your shell startup scripts.
1
vote
How do I get a locale or timezone used on Venus?
The question concerns the non-quoting, double-quoting, and single-quoting of a command substitution.
The point made in that answer is that without double-quoting the command substitution $(date) or `...
1
vote
Preview locales
You could do something like:
LC_ALL=en_DK.UTF-8 locale -kc $(
locale | sed '/^LC_/!d;/^LC_ALL=/d;s/=.*//'
)
(assuming $IFS not modified from its default) which would give you keyword=values for ...
1
vote
Accepted
Change locale LC_NUMERIC decimal_point for shell or individual command
As somebody(?)
pointed out, you should probably have the “C” or “POSIX” locale
on even a minimal system.
So, as you probably understand, you should be able to say
LC_NUMERIC=C
or
LC_NUMERIC=POSIX
(...
1
vote
Change locale LC_NUMERIC decimal_point for shell or individual command
You can set environment variables for a single command:
LC_ALL=C yourcommand
1
vote
How to get the current value of LC_CTYPE etc. in Bash?
If you just want to parse the output of locale and then set the variable, you can just source it directly like this:
. <(locale | grep '^LC_CTYPE=')
That selects only the LC_TYPE line:
$ locale | ...
1
vote
Accepted
Why is MB_CUR_MAX 6 instead of 4 for UTF-8? (Linux, glibc)
According to Wikipedia, UTF-8 indeed needed up to 6 bytes until 2003, when RFC 3629 added some constraints:
UTF-8 was first officially presented at the USENIX conference in San
Diego, from January 25 ...
1
vote
Accepted
How to completely remove locale from Manjaro Linux?
In the comments, you already checked and fixed ~/.config/plasma-localerc.
Check also the system default locale settings, using the localectl command. Those system defaults might be the only locale ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
locale × 529debian × 83
unicode × 51
linux × 47
character-encoding × 44
bash × 38
sort × 35
arch-linux × 32
date × 26
language × 25
centos × 23
ubuntu × 19
environment-variables × 17
terminal × 16
i18n × 15
shell × 14
ls × 14
linux-mint × 13
kde × 13
macos × 13
posix × 12
xfce × 11
x11 × 10
gnome × 10
man × 10