Skip to content

Commit

Permalink
Allow the use of C.UTF-8 locale
Browse files Browse the repository at this point in the history
  • Loading branch information
nviennot committed Oct 13, 2019
1 parent 74ff522 commit 7153958
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tmux.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 7153958

Please sign in to comment.