Bugzilla – Bug 148056
Unreadable prompts at login on linux console in Japanese
Last modified: 2006-02-15 16:29:16 UTC
When the system is installed with Japanese as the primary language, login shows the password prompt with unreadable letters, and then displays the "Last login: " with also unreadable letters for the date. This is because linux console cannot show CJK letters as default. But, the question is why it's shown even the locale of root user doesn't set LANG to ja_JP.UTF-8 at all. The output of "locale" as root is: LANG=POSIX LC_CTYPE=ja_JP.UTF-8 LC_NUMERIC="POSIX" LC_TIME="POSIX" LC_COLLATE="POSIX" LC_MONETARY="POSIX" LC_MESSAGES="POSIX" LC_PAPER="POSIX" LC_NAME="POSIX" LC_ADDRESS="POSIX" LC_TELEPHONE="POSIX" LC_MEASUREMENT="POSIX" LC_IDENTIFICATION="POSIX" LC_ALL=
Created attachment 66959 [details] bugzilla-148065.patch patch for login.c in the pwdutils package to fix the problem. Also improves handling of the locale variables, RC_LC_MESSAGES was ignored.
Reassign to "pwdutils" maintainer to submit the patch.
I don't understand: Why do you use such a locale and try to login on console if the console is not able to use them?
The patch above _disables_ the locale setting for languages which don't work with linux console. RC_LANG is set to ja_JP.UTF-8 when you select japanese in YaST2. It's not any part of normal locale setting, but only strange programs like /bin/login or yast refer to it.
Example: Default installation in Japanese -> RC_LANG="ja_JP.UTF-8" in /etc/sysconfig/language, no other RC_* set in /etc/sysconfig/language. Now try to login on the Linux console. You see: login: root ??????: The row of question marks is the translation of "Password" in Japanese which cannot be displayed on the Linux console.
For many languages, e.g. German, French, Russian, which are supported by the current Linux console, this works just fine and you will see a readable translation of "Password" when logging in. But the Linux console currently doesn't support CJK languagues, Indian languages, Khmer, ... Maybe one day the Linux console will be improved to support it, but currently it is not possible. Therefore I added a list of execptions to login.c. For languages in this list, the RC_* values from /etc/sysconfig/language are ignored. The LC_MESSAGES change was a correctnes fix.
This all does not even try to answer my question. About RC_LANG: LANG is set to this value and is part of the normal locale settings.
But during login, the locale settings are not active because no profiles have been sourced yet. Therefore, login.c reads the values directly from /etc/sysconfig/language.
Thorsten, please read my original post: The locale is set to POSIX, indeed (for root user, because of RC_USE_LANG=ctype). And, user can start fbiterm or whatever after login, so setting that language is also fine. But, /bin/login shows _always_ broken letters. That is, the question is not the locale after login but the locale /bin/login uses.
Created attachment 68660 [details] bugzilla-148065.patch improved patch to prever the locale environment variables if set.
If hte locale environment variables are set, they should probably be preferred. They are rarely ever set though when "login" is called because - when login is called when loggin in on the linux console or via a serial console, no profiles have been sourced yet - when login is called from a telnet server, only a few environment variables are set, the locale environment variables are not set. For example when trying "telnet localhost" I get: mfabian@magellan:~$ ps aux | grep login root 19206 0.0 0.1 30040 864 ? Ss Feb14 0:00 login -- mfabian root 31927 0.0 0.1 22924 1012 pts/16 Ss+ 16:27 0:00 /bin/login -h localhost -p mfabian 1659 0.0 0.1 5888 864 pts/17 S+ 16:27 0:00 grep login mfabian@magellan:~$ sudo cat /proc/31927/environ | xargs -0 -n 1 echo DISPLAY=magellan.suse.de:0.0 TERM=mlterm REMOTEHOST=localhost mfabian@magellan:~$
Fixed package submitted to STABLE: ------------------------------------------------------------------- Tue Feb 07 21:28:13 CET 2006 - mfabian@suse.de - bugzilla #148065: login.c: use locale environment variables if available and fall back to parsing /etc/sysconfig/language only if not. Observe LC_MESSAGE as well and don't use translations for languages which cannot be displayed currently on the Linux console. ------------------------------------------------------------------- Closing as FIXED.