set locale terminal settings on Mac OS X

One of my first experiences with Mac OS, was the locale errors and warnings when using ssh connections. Then I understood, that this was a problem occurred by mac os terminal. Locale settings by default are accepted from ssh client.

Then I run:

$locale

and the output was:

LANG=
LC_COLLATE="C"
LC_CTYPE="C"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

I then edited /etc/profile and added these two lines:

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

Then I opened a new terminal session and run:

$locale

and the output was:

LANG="en_US.UTF-8"  
LC_COLLATE="en_US.UTF-8"  
LC_CTYPE="en_US.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="en_US.UTF-8"

After these committing these changes, I transfer my locale settings to my ssh connections and all problems solved.

2 thoughts on “set locale terminal settings on Mac OS X”

Leave a Reply

Your email address will not be published. Required fields are marked *

Prove me that you are not a robot :) * Time limit is exhausted. Please reload the CAPTCHA.