1

When typing German umlauts (ä,ö,ü) into the terminal (I am using st on Arch Linux, $XTERM is st-256color), it displays only <ffffffff>. Locale seems to be set properly.

Output of locale is

locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=de-DE.UTF-8
LC_CTYPE=de-DE.UTF-8
LC_NUMERIC="de-DE.UTF-8"
LC_TIME="de-DE.UTF-8"
LC_COLLATE="de-DE.UTF-8"
LC_MONETARY="de-DE.UTF-8"
LC_MESSAGES="de-DE.UTF-8"
LC_PAPER="de-DE.UTF-8"
LC_NAME="de-DE.UTF-8"
LC_ADDRESS="de-DE.UTF-8"
LC_TELEPHONE="de-DE.UTF-8"
LC_MEASUREMENT="de-DE.UTF-8"
LC_IDENTIFICATION="de-DE.UTF-8"
LC_ALL=

In locale.conf I only set

LANG="de-DE.UTF-8"
LC_CTYPE="de-DE.UTF-8"

In locale.gen I uncommented de-DE.UTF-8. Where could it go wrong?

2
  • 2
    After editing locale.gen, did you also run the locale-gen command?
    – telcoM
    Commented May 13, 2022 at 6:11
  • Yes, output is Generating locales... de_DE.UTF-8... done en_US.UTF-8... done zh_CN.UTF-8... done Generation complete.
    – l2poca
    Commented May 13, 2022 at 16:32

1 Answer 1

0

The actual locale names have an underscore between the language code and the country code, i.e. your locale.conf should be:

LANG="de_DE.UTF-8"
LC_CTYPE="de_DE.UTF-8"

Currently, you have minus signs (-) instead of underscores (_). Since your locale specifications are not valid, the system is falling back to the POSIX locale and US-ASCII character set only.

The LANG variable sets the default for all the other locales, so just setting

LANG=de_DE.UTF-8

is equivalent to setting all the category-specific LC_* locale variables to the same value, unless you override specific categories with any of the LC_* variables.

So if you set LANG=de_DE.UTF-8, you should not need LC_CTYPE=de_DE.UTF-8 since setting LANG already sets it as the new default for LC_CTYPE. However, if you don't like translated error messages and wish to keep them in English, you might want to set LC_MESSAGES=en_US.UTF-8 to override the LANG value for the LC_MESSAGES category only.

The output of your locale command also reflects this: it shows all the category specific variables as set to the same (incorrect) value as your current LANG setting.

LC_ALL is a master override for all the locale settings: you'll most commonly see it with some pipelines that are parsing some command output that might be affected by localization. Prefixing such pipelines with LC_ALL=POSIX or LC_ALL=en_US.UTF-8 guarantee that the script writer needs to design the output parsing for that particular locale only, no matter which locale the user is using otherwise.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .