My OS X (Mavericks) seems to be setting LC_CTYPE environmental variable to UTF-8 by default.

How can I change the default? I need LC_CTYPE to be en_US.UTF-8.

There's a catch: I don't want to overwrite default with another value by using export LC_CTYPE=en_US.UTF-8 in my local .profile or .bash_rc. I'm interested in changing the default itself, at the very root wherever it comes from, so that it works without additional startup scripts (and also I'm curious what controls env vars in OS X :)

The reason I want to change it at the very source is that I want to be able to:

  • launch remote shell quickly in iTerm2, which doesn't run local shell's (slow-ish) startup script
  • have remote servers inherit my local LC_ variables so that I have UTF-8 support on other machines without having to configure them specifically.
  • adding LC_CTYPE=en_US.UTF-8 doesn't overwrite anything. You always log into your shell via your $PATH. Otherwise you'd be presented with bash [version] # as in recovery mode Terminal. Explicitly including this in your profile is equivalent to modifying the setting described in the answer below. The benefit of including it in your path is that is explicitly defines the ENV for $HOME. This is what you want.
    – njboot
    Jun 19, 2014 at 7:05

1 Answer 1


In Terminal.app you can change the default encoding in the Advanced settings. This will be set before it spawns a shell.

Looks like iTerm2 has the setting under Preferences, Profiles, Terminal.

Is that 'the very source' you are looking for?

You must log in to answer this question.

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