3

I have found a number of questions on various forums where Mac users complain about locale errors when they log in to Linux systems over SSH which complain that the LC_CTYPE=UTF-8 setting is incorrect.

In some more detail, the shell on MacOS seems to set this value, and then (if you have the option enabled in Terminal, or etc) your local LC_* variables get exported to the remote system when you SSH in.

Linux insists that LC_CTYPE needs to be set to a valid locale (sometimes you can fix this with localegen as admin on the Linux system) but UTF-8 is not a locale in the first place.

My primary question is, is this a bug in MacOS? Or is Linux wrong in insisting that the variable needs to be set to a fully specified locale name?

Secondarily, in order to be able to argue which one is correct and why, where is this specified?

Tertiarily, is there something these Mac users (myself included) could or should do differently?

The obvious workaround is to put something like

LC_CTYPE=en_US.UTF-8

in your .bash_profile, but this obviously only solves it for your personal account, and hardcodes a value which may or may not agree with your other locale settings.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.