Ich nutze iTerm2 als Terminal Programm auf macOS. Wenn ich mich von dort dann auf Linux Systemen per SSH einlogge, habe ich oft eine solche Fehlermeldung:
$ ssh front1 Linux front1 3.16.0-7-amd64 #1 SMP Debian 3.16.59-1 (2018-10-03) x86_64 The programs included with the Debian GNU/Linux system are free software; … alex@front1 ~> perl perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = (unset), LC_ALL = (unset), LC_CTYPE = "UTF-8", LANG = "en_US" are supported and installed on your system. perl: warning: Falling back to a fallback locale ("en_US").
Grund ist, das LC_CTYPE auf einen illegalen Wert „UTF-8“ gesetzt ist. Ein sudo fgrep -ri LC_CTYPE /etc $HOME zeigte aber, das es weder in $HOME noch in /etc gesetzt wird.
Lösung:
Dank Remi Bergsma und seinem Post „Setting locales correctly on Mac OSX Terminal application“ bin ich darauf gekommen, das auch iTerm2 eine Einstellmöglichkeit hat, um die Locale „magisch“ „richtig“ zu setzen:
Mein System ist auf schweizerdeutsch (de_CH) eingestellt, und scheinbar kommt iTerm2 damit nicht so ganz klar. Wenn ich diese Einstellung deaktiviere, wird’s etwas besser:
$ locale LANG= LC_COLLATE="C" LC_CTYPE="en_US.UTF-8" LC_MESSAGES="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_ALL=
Ist aber immer noch nicht so gut wie die Terminal App von macOS, die es so setzt:
$ locale LANG="de_CH.UTF-8" LC_COLLATE="de_CH.UTF-8" LC_CTYPE="de_CH.UTF-8" LC_MESSAGES="de_CH.UTF-8" LC_MONETARY="de_CH.UTF-8" LC_NUMERIC="de_CH.UTF-8" LC_TIME="de_CH.UTF-8" LC_ALL=
Muss man wohl manuell einstellen bei iTerm2.