Valid values for LC_CTYPE?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












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.










share|improve this question

















  • 1





    For instance this. POSIX doesn't happen to address adequately what happens when different systems can't agree on the valid locale settings, though you're certain to get opinion in lieu of fact here.

    – Thomas Dickey
    Feb 26 at 22:26











  • Section 7 of POSIX 1003.1 does discuss this at some length (you linked to section 8).

    – tripleee
    Feb 27 at 10:42











  • This seems relevant too: unicode-org.atlassian.net/browse/ICU-6565 -- here is the corresponding commit: github.com/unicode-org/icu/commit/…

    – tripleee
    Feb 27 at 10:52
















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.










share|improve this question

















  • 1





    For instance this. POSIX doesn't happen to address adequately what happens when different systems can't agree on the valid locale settings, though you're certain to get opinion in lieu of fact here.

    – Thomas Dickey
    Feb 26 at 22:26











  • Section 7 of POSIX 1003.1 does discuss this at some length (you linked to section 8).

    – tripleee
    Feb 27 at 10:42











  • This seems relevant too: unicode-org.atlassian.net/browse/ICU-6565 -- here is the corresponding commit: github.com/unicode-org/icu/commit/…

    – tripleee
    Feb 27 at 10:52














3












3








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.










share|improve this question














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.







linux osx locale i18n






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Feb 26 at 11:09









tripleeetripleee

5,28811930




5,28811930







  • 1





    For instance this. POSIX doesn't happen to address adequately what happens when different systems can't agree on the valid locale settings, though you're certain to get opinion in lieu of fact here.

    – Thomas Dickey
    Feb 26 at 22:26











  • Section 7 of POSIX 1003.1 does discuss this at some length (you linked to section 8).

    – tripleee
    Feb 27 at 10:42











  • This seems relevant too: unicode-org.atlassian.net/browse/ICU-6565 -- here is the corresponding commit: github.com/unicode-org/icu/commit/…

    – tripleee
    Feb 27 at 10:52













  • 1





    For instance this. POSIX doesn't happen to address adequately what happens when different systems can't agree on the valid locale settings, though you're certain to get opinion in lieu of fact here.

    – Thomas Dickey
    Feb 26 at 22:26











  • Section 7 of POSIX 1003.1 does discuss this at some length (you linked to section 8).

    – tripleee
    Feb 27 at 10:42











  • This seems relevant too: unicode-org.atlassian.net/browse/ICU-6565 -- here is the corresponding commit: github.com/unicode-org/icu/commit/…

    – tripleee
    Feb 27 at 10:52








1




1





For instance this. POSIX doesn't happen to address adequately what happens when different systems can't agree on the valid locale settings, though you're certain to get opinion in lieu of fact here.

– Thomas Dickey
Feb 26 at 22:26





For instance this. POSIX doesn't happen to address adequately what happens when different systems can't agree on the valid locale settings, though you're certain to get opinion in lieu of fact here.

– Thomas Dickey
Feb 26 at 22:26













Section 7 of POSIX 1003.1 does discuss this at some length (you linked to section 8).

– tripleee
Feb 27 at 10:42





Section 7 of POSIX 1003.1 does discuss this at some length (you linked to section 8).

– tripleee
Feb 27 at 10:42













This seems relevant too: unicode-org.atlassian.net/browse/ICU-6565 -- here is the corresponding commit: github.com/unicode-org/icu/commit/…

– tripleee
Feb 27 at 10:52






This seems relevant too: unicode-org.atlassian.net/browse/ICU-6565 -- here is the corresponding commit: github.com/unicode-org/icu/commit/…

– tripleee
Feb 27 at 10:52











0






active

oldest

votes











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503110%2fvalid-values-for-lc-ctype%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f503110%2fvalid-values-for-lc-ctype%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown






Popular posts from this blog

Peggy Mitchell

The Forum (Inglewood, California)

Palaiologos