[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Looking for help with locale configuration



Hi list,

I'm looking for help in understanding how locales work and how to configure my 
system running Debian Testing.

During the Debian installation (graphical) I configured my locale to be 
"en_SE.UTF-8".
Recently a python script crashed with the error message "unsupported locale 
setting" after trying to set LC_ALL to an empty string and I cannot get it to 
work with the en_SE.UTF-8 locale.

I use KDE. If I look in Settings -> Regional Settings -> Format it says 
en_SE.UTF-8 (no adjustments). 

The 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=en_SE.UTF-8
LANGUAGE=
LC_CTYPE="en_SE.UTF-8"
LC_NUMERIC="en_SE.UTF-8"
LC_TIME="en_SE.UTF-8"
LC_COLLATE="en_SE.UTF-8"
LC_MONETARY="en_SE.UTF-8"
LC_MESSAGES="en_SE.UTF-8"
LC_PAPER="en_SE.UTF-8"
LC_NAME="en_SE.UTF-8"
LC_ADDRESS="en_SE.UTF-8"
LC_TELEPHONE="en_SE.UTF-8"
LC_MEASUREMENT="en_SE.UTF-8"
LC_IDENTIFICATION="en_SE.UTF-8"
LC_ALL=

A few observations:

- `dpkg-reconfigure locales` does not let me choose the en_SE.UTF-8 locale. 
The closest matches are sv_SE.UTF-8 and en_US.UTF-8. /etc/locales.gen also 
lacks en_SE.UTF-8.

- If I set my locale to sv_SE.UTF-8 or en_US.UTF-8 the python script works 
fine. Also, the "locale: ..." error messages (?) from the output of `locale -a` 
disappears.

- If I use `localectl` to set the locale to something else than is configured 
in KDE this is not picked up. KDE and `locale` will show different values.

I want to have the exact locale settings of en_SE.UTF-8. If possible I would 
also prefer to avoid being dependant on my desktop environment to configure 
this (i.e. use localectl or similar). Obviously I also want the Python script 
to work.

I feel like there is something I don't understand. Any advice or explanation 
would be deeply appreciated!

// Rasmus



Reply to: