Consequences of setting up POSIX locales

8,235

See What should I set my locale to and what are the implications of doing so? for a full overview of locale settings. In a nutshell, the one useful difference between C and en_US is the LC_CTYPE setting: C restricts applications to ASCII while en_US allows latin1. A good setting for a US English environment is to set LC_CTYPE=en_US.UTF-8, specifying the UTF-8 encoding of the Unicode character set which is the de facto standard character encoding nowadays; and leave other settings unset (which is equivalent to C (or POSIX which is synonymous)).

Share:
8,235
Kris
Author by

Kris

Updated on September 18, 2022

Comments

  • Kris
    Kris over 1 year

    We are using several Ubuntu servers having English as working language; however having en_US locale set in machines we encounter problems with apt-cacher-ng downloading translation files. One solution is to change locale to POSIX. Considering all options we want to change locale in all the systems.

    What are the consequences for the system of changing locales from en_US value to POSIX? Are there any implications on LC_* apart from change of the value?

    • Toby Speight
      Toby Speight almost 9 years
      Change the default system locale, for all processes of all users? Or just change the locale of apt-cacher-ng? The latter is less risky, I think.
    • tripleee
      tripleee about 7 years
      Are you perhaps actually looking for unix.stackexchange.com/questions/62316/…?
  • Rainer Blome
    Rainer Blome over 3 years
    "C restricts applications to ASCII while en_US allows latin1"? In how far? With "C" in effect, on the systems that I use, latin1-encoded text usually displays as intended. In my experience, when input is processed, C means "use the bytes as they are". Maybe you mean the text generated by applications. Yes, with C in effect I would expect that to be limited to ASCII. Can you elaborate?
  • Gilles 'SO- stop being evil'
    Gilles 'SO- stop being evil' over 3 years
    @RainerBlome For example: If you have a terminal that defaults to UTF-8 (which is pretty common these days), attempting to display latin1 won't display the characters as intended. If you search for [[:alpha:]] with grep, it won't find é. If you try to process file in a program written in Python that expects a text file, it'll crank out on non-ASCII characters.