Setting SSH locale properly in OS X

by , , revisited on

We have by far the largest RPM repository with dynamic stable NGINX modules and VMODs for Varnish 4.1 and 6.0 LTS. If you want to install NGINX, Varnish, and lots of useful modules for them, this is your one-stop repository to get all performance-related software.
You have to maintain an active subscription in order to be able to use the repository!

Ever seen a message in your iTerm or Terminal apps telling you there’s a problem setting locale?

It may be when you run a Perl app:

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = “en_US.UTF-8”
are supported and installed on your system.

Or even more likely, once you initiated a connection to remote server via SSH:

-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

There are many ways you can find online suggested as the fix. But what is the scientifically correct answer to the problem?

Many suggest that your server is flawed and is missing a locale. They suggest to generate one. But it’s not technically a valid locale “UTF-8”.

Your server is not flawed. OS X default SSH client configuration is.

Add to your ~/.profile:

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

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: