7

I've seen useful posts on LC_ALL=C and resolving problems with locale settings, but those look a bit too complicated to me.

In a session started with LC_ALL=C bash I've tried the obvious LC_ALL=nl_NL, but that gave warnings, so I'm unsure if that is the proper way to go when setting LC_ALL=C (without bash)

Cor Nouws
  • 101
  • 5
    Have you tried just setting it to the empty string i.e. LC_ALL=? AFAIK it is typically unset by default - only if set, it overrides the individual locale variables such as LC_NUMERIC, LC_MESSAGES etc. – steeldriver Aug 05 '16 at 12:37
  • A less intrusive way to get English output in terminal is LANGUAGE=en_US – Gunnar Hjalmarsson Aug 05 '16 at 18:19
  • after LC_ALL=C for me the locale still shows "LC_ALL=" Also, after applying LC_ALL=C and then LC_ALL=nl-NL, I noticed the command line output with wrong special characters, missing UTF-8 apparently. Maybe I should have used LC_ALL=nl-NL.UTF-8 .. Can try. – Cor Nouws Aug 05 '16 at 19:02
  • It's nl_NL.UTF-8 - with an underscore, not dash. – Gunnar Hjalmarsson Aug 05 '16 at 20:29
  • you may need to type export LC_ALL=C to change locale the first time – Zanna Aug 05 '16 at 21:09

2 Answers2

10

@steeldriver is right, unsurprisingly. All you need to do is

LC_ALL=

to restore all your normal locale settings for the session.

Example:

$ export LC_ALL=C
$ locale
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C

setting LC_ALL= restores the original locale settings

$ LC_ALL=
$ locale
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=en_GB.UTF-8
LC_TIME=en_GB.UTF-8
LC_COLLATE="en_GB.UTF-8"
LC_MONETARY=en_GB.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=en_GB.UTF-8
LC_NAME=en_GB.UTF-8
LC_ADDRESS=en_GB.UTF-8
LC_TELEPHONE=en_GB.UTF-8
LC_MEASUREMENT=en_GB.UTF-8
LC_IDENTIFICATION=en_GB.UTF-8
LC_ALL=
Zanna
  • 70,465
6

The probable reason why LC_ALL=nl_NL gave you warnings is that nl_NL is a locale for enabling ISO-8859-1 encoding, and it's typically not generated on an Ubuntu system. LC_ALL=nl_NL.UTF-8 should work. As others have said, LC_ALL= (i.e. disabling it) works too.

Gunnar Hjalmarsson
  • 33,540
  • 3
  • 64
  • 94