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

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
  • 72,312
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.