2

It seems like typically:

echo $LANG

results in something like this:

en_US.UTF-8

What encoding is used when the result does not specify an encoding?

echo $LANG
en_US

How do I figure out what the default encoding is?

Using CentOS and Redhat (various versions).

2

You can use locale.

Current encoding:

locale charmap

All available encoding:

locale -m

Example with my system:

$ locale charmap
UTF-8

$ LC_ALL=C export LC_ALL
$ locale charmap        
ANSI_X3.4-1968

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.