Bug 441468 - Locale breaks when changing region
Summary: Locale breaks when changing region
Status: RESOLVED DUPLICATE of bug 403580
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_formats (show other bugs)
Version: 5.22.4
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Sebastian Kügler
Depends on:
Reported: 2021-08-24 08:31 UTC by lars
Modified: 2021-09-30 17:51 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description lars 2021-08-24 08:31:29 UTC
Locale breaks when changing region, which results in a lot of different errors like crashing applications and error logs when updating/upgrading packages with apt.

1. Install a fresh copy of Kubuntu 21.04 with the default language being American English
2. Change the country under System Settings -> Regional Settings -> Formats -> Region to Germany (in my case, this is not just a bug specific to Germany) 
3. enter "perl" into a terminal and watch the locale break. You should see something like this:
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
        LANGUAGE = "en_US",
        LC_ALL = (unset),
        LC_ADDRESS = "de_DE.UTF-8",
        LC_NAME = "de_DE.UTF-8",
        LC_MONETARY = "de_DE.UTF-8",
        LC_PAPER = "de_DE.UTF-8",
        LC_IDENTIFICATION = "de_DE.UTF-8",
        LC_TELEPHONE = "de_DE.UTF-8",
        LC_MEASUREMENT = "de_DE.UTF-8",
        LC_TIME = "de_DE.UTF-8",
        LC_NUMERIC = "de_DE.UTF-8",
        LANG = "en_DE.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

Simply changing the region to a different language breaks the locale, which can lead to a plethora of different problems outlined in other reports of this bug (linked below).

In my case for example, anki crashes in program launch because of a broken UTF-8 locale

Here is an old report of one user changing his region to Greek:
New installation of Kubuntu 14.04 and upgraded via kubuntu-ppa. Initially, country is set to "United States". The locale settings are the following:

~/.kde/env$ cat setlocale.sh
export LANG=en_US.UTF-8
export LANGUAGE=en:el:en
export LC_NUMERIC=en_US.UTF-8
export LC_TIME=en_US.UTF-8
export LC_MONETARY=en_US.UTF-8
export LC_PAPER=en_US.UTF-8
export LC_NAME=en_US.UTF-8
export LC_ADDRESS=en_US.UTF-8

Then, I change Country to Greece, via System Settings. Locale changes as follows:

export LANG=en_GR.UTF-8
export LANGUAGE=en:el:en
export LC_NUMERIC=en_GR.UTF-8
export LC_TIME=en_GR.UTF-8
export LC_MONETARY=en_GR.UTF-8
export LC_PAPER=en_GR.UTF-8
export LC_NAME=en_GR.UTF-8
export LC_ADDRESS=en_GR.UTF-8

As far as I know, en_GR.UTF-8 is not a valid entry. A severe loss of functionality is that accents cannot be set properly to greek vowels.
Even there is no setlocale.sh on my system, there is a /etc/default/locale file, which is essentially the same but without all the export statements.

You can partially fix this issue by editing that file, but I still haven't been able to fix the errors perl throws at me. I would like to retest this with a fresh installation but I cannot get VirtualBox running.

The locale should be correct after changing the region.

Linux/KDE Plasma: 21.04
(available in About System)
KDE Plasma Version: 5.22.4
KDE Frameworks Version: 5.85.0
Qt Version: 5.15.2

https://bugs.kde.org/show_bug.cgi?id=335301 is the initial report of this from seven years ago, and even though it was "resolved downstream", its still an issue seven years later. These kind of bugs are what gets a lot of users (including me, at least once!) to switch back to windows or mac because they get these basics right. I shouldn't have to edit a config file in order for my PC to work out of the box. And living in Germany/Greece/Norway or wherever and simply wanting your PC to be in English is, and should not, be "wrong", impossible or result in a broken locale, like some others pointed out.

Personally I found the above bug report via https://bugs.launchpad.net/ubuntu/+source/kde-runtime/+bug/1322968, which was closed yesterday. We were asked to open a new bug report with this issue here, as you can see by the last few comments on that bug report.
Comment 1 Nate Graham 2021-09-30 17:49:39 UTC

*** This bug has been marked as a duplicate of bug 441010 ***
Comment 2 Nate Graham 2021-09-30 17:51:15 UTC

*** This bug has been marked as a duplicate of bug 403580 ***