Fixing that weird locale error when SSHing to a server

Each time I ssh to my server I'd keep seeing this error:

perl: warning: Setting locale failed.  
perl: warning: Please check that your locale settings:  
    LANGUAGE = (unset),
    LC_ALL = (unset),
    LC_CTYPE = "UTF-8",
    LANG = "C"
    are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").  

What's happening here?

According to Greg Bacon, the environment variables for the locale gets sent to the server. Since the server doesn't have the locale requested by my client, I end up seeing that error.

The fix is quite simple. Edit the sshd.conf file and don't ask it to pass locale information to the server.

sudo nano /etc/ssh/sshd_config  

Find the line with:

# pass locale information
AcceptEnv LANG LC_*  

And comment it off:

# pass locale information
# AcceptEnv LANG LC_*