deutrino's picture

Does anyone know if there is a reason LC_ALL and LC_CTYPE are set to C in /etc/default/locale, and this doesn't seem to get updated when changing the default locale in confconsole? Is this default behavior of Debian 11, or Turnkey specific?

I am trying to work with Elixir on a Turnkey appliance, and it's unhappy that a UTF-8 locale (such as, presumably, C.UTF-8) isn't set in one or both of these variables.

Forum: 
Jeremy Davis's picture

Deep apologies on how long it's taken me to respond to your relatively simple question. FWIW, I've been having massive issues with the website (and now our mailserver). I think the website is nearly done (a few more minor bits to tidy up).

Anyway, to answer your question, the current locale setup is inherited from Debian. I have looked at improving it, primarily to suppress the warning that looks something like this (this is mine, as an Aussie, I use en_AU.UTF8 for most stuff, but default to en_US.UTF8):

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = "en_US.UTF-8",
	LC_ALL = (unset),
	LC_TIME = "en_AU.utf8",
	LC_MONETARY = "en_AU.utf8",
	LC_CTYPE = "C",
	LC_COLLATE = "C",
	LC_MEASUREMENT = "en_AU.utf8",
	LC_NUMERIC = "en_AU.utf8",
	LC_PAPER = "en_AU.utf8",
	LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

After reading through all the docs I could find, it's recommended to not change that by default (i.e. leave LC_ALL unset and LC_CTYPE as "C". By my understanding, the rationale behind that is to ensure that if users with other locale setups log in via SSH, that their locale settings will be honored.

I suggest that you consult the Debian locale wiki page. Bottom line, you can set it as you desire:

update-locale LANG="_VALUE_" LANGUAGE="_VALUE_" LC_ALL="_VALUE_"

Where '_VALUE_' is one of the valid locales (all supported ones are listed in /usr/share/i18n/SUPPORTED.

Then re-run:

dpkg-reconfigure locales

Add new comment