In some cases, sulogin can set LC_CTYPE="POSIX" while retaining the
original LC_MESSAGES. In this scenario, the gettext() function may not
work as intended and sulogin returns "???" (for example for
ja_JP.UTF-8). GNU gettext FAQ:
This symptom occurs when the LC_CTYPE facet of the locale is not set;
then gettext() doesn't know which character set to use, and converts
all messages to ASCII, as far as possible.
Addresses: https://issues.redhat.com/browse/RHEL-56983
Addresses: https://github.com/util-linux/util-linux/issues/2185
Signed-off-by: Karel Zak <kzak@redhat.com>
}
setlocale(LC_CTYPE, "POSIX");
+ setlocale(LC_MESSAGES, "POSIX");
goto setattr;
}
#if defined(IUTF8) && defined(KDGKBMODE)
case K_XLATE:
default:
setlocale(LC_CTYPE, "POSIX");
+ setlocale(LC_MESSAGES, "POSIX");
break;
}
#else
setlocale(LC_CTYPE, "POSIX");
+ setlocale(LC_MESSAGES, "POSIX");
#endif
reset_virtual_console(tio, flags);
setattr: