In my ~/.profile

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

But $ locale prints empty LC_ALL:


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

  • 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 Jul 26 '17 at 11:48

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 🍻


ZSH seems not to source ~/.profile

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

  • 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}. – dan Jul 26 '17 at 9:46

You must log in to answer this question.

protected by Community Jun 19 '18 at 11:50

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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