Allow the use of C.UTF-8 locale

This commit is contained in:
Nicolas Viennot 2019-10-12 21:09:39 -04:00
parent 74ff522983
commit 7153958e99

6
tmux.c
View File

@ -205,12 +205,12 @@ main(int argc, char **argv)
const char *s;
int opt, flags, keys;
if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL) {
if (setlocale(LC_CTYPE, "en_US.UTF-8") == NULL &&
setlocale(LC_CTYPE, "C.UTF-8") == NULL) {
if (setlocale(LC_CTYPE, "") == NULL)
errx(1, "invalid LC_ALL, LC_CTYPE or LANG");
s = nl_langinfo(CODESET);
if (strcasecmp(s, "UTF-8") != 0 &&
strcasecmp(s, "UTF8") != 0)
if (strcasecmp(s, "UTF-8") != 0 && strcasecmp(s, "UTF8") != 0)
errx(1, "need UTF-8 locale (LC_CTYPE) but have %s", s);
}