Files
blog/content/posts/2011-10-06-linux-locale-problems-over-ssh-from-a-mac.md
T
2023-02-25 17:25:14 +01:00

1.5 KiB
Raw Blame History

title, author, type, date, url, aktt_notify_twitter, aktt_tweeted, dsq_thread_id, categories
title author type date url aktt_notify_twitter aktt_tweeted dsq_thread_id categories
Linux locale problems over ssh from a Mac James McDonald post 2011-10-06T08:07:16+00:00 /2011/10/linux-locale-problems-over-ssh-from-a-mac/
yes
1
438230874
Debian
Hacks
Ubuntu

Most users of Debian/Ubuntu have at some time seen these annoying messages:

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

There are a variety of causes usually locales not being generated properly or incorrect environment variables.

Lately Ive been getting these a lot of these, but only some of the time. After some messing around I eventually discovered the problem wasnt on the server itself. The problem only occurs when Im logged in over SSH from a Mac. The default sshd on Debian copies LANG and LC_ variables* from the client. The LC_CTYPE variable was set on my Mac, apparently by default, to “UTF-8”. While this seems to work on MacOS X, its not a valid value for Linux.

The easiest solution was just to add the following to my ~/.profile on the Mac:

<br /> export LC_CTYPE=en_GB.UTF-8<br />

That fixes it, and doesnt appear to cause harm on the Mac.