Skip to main content
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 ...
Stéphane Chazelas's user avatar
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' "$...
Kusalananda's user avatar
  • 341k
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 ...
MC68020's user avatar
  • 8,329
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 ...
Vlastimil Burián's user avatar
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 ...
Marcus Müller's user avatar
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 ...
nneonneo's user avatar
  • 1,178
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 ...
don_crissti's user avatar
  • 83.9k
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 ...
Stephen Kitt's user avatar
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 ...
Claus Andersen's user avatar
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.
Stephen Kitt's user avatar
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 `...
Kusalananda's user avatar
  • 341k
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 ...
Stéphane Chazelas's user avatar
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 (...
G-Man Says 'Reinstate Monica''s user avatar
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
waltinator's user avatar
  • 5,445
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 | ...
terdon's user avatar
  • 245k
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 ...
Sebastian Carlos's user avatar
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 ...
telcoM's user avatar
  • 103k

Only top scored, non community-wiki answers of a minimum length are eligible