0

In my ~/.profile

export LC_ALL=en_US.UTF-8  
export LANG=en_US.UTF-8

But $ locale prints empty LC_ALL:

LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=

How can I set LC_ALL to "en_US.UTF-8" ?

1
  • 1
    locale is set by the terminal emulator (Terminal.app) when you start the app and LC_ALL does not need to be set unless you want to change the default LANG settings for LC_COLLATE and others.
    – fd0
    Commented Jul 26, 2017 at 11:48

2 Answers 2

2

FYI, LC_ALL is an env var you DO NOT want to set from what I have been reading. It is there for developers for debugging purposes when they need to quickly change all the locale settings ie. env vars you listed above for a particular environment as it overwrites / supersedes all the other locale env vars, thus that is why it is left unset.

cheers 🍻
Chris

-1

ZSH seems not to source ~/.profile

I added the two export statements into ~/.zshrc and the issue is solved.

1
  • The right file to set these is: ~/.zprofile. You don't need to repeat these settings for every shell or subshell: once per session is enough. Moreover, once LANG is set, and if the LC_… aren't different, they don't need to be set, they will inherit ${LANG}.
    – athena
    Commented Jul 26, 2017 at 9:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .