Gentoo Archives: gentoo-user

From: "Florian v. Savigny" <lorian@××××××××.de>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Re: Kernel update messed up console encoding
Date: Sun, 01 Mar 2009 12:25:26
Message-Id: 0ML2xA-1LdkjN38jj-0006GL@mrelayeu.kundenserver.de
In Reply to: [gentoo-user] Re: Kernel update messed up console encoding by Nikos Chantziaras
1 Hi Nikos,
2
3 > > $LANG and $LC_ALL are not set (i.e. locale simply shows
4 > > "LANG=" and "LC_ALL=" with no values). All other LC_... variables are
5 > > set to "POSIX".
6 >
7 > I don't think that will work.
8
9 Interestingly, I just discovered the locales are different for one
10 user (who has "de_DE.iso-8859-1" for all variables (including LANG)
11 except LC_ALL, which is empty). For the other users, the locales are
12 as above, and it is this way no matter which kernel is running. But
13 the console does not behave differently for the two users, but
14 differently for the two kernels (i.e. identically for both users).
15
16 So, the bottom line is: that is apparently not the heart of the
17 problem either, as the setting cited above DOES work under my kernel
18 2.6.17. But thanks for having me discover the user-specific locale
19 settings! I wasn't aware of that.
20
21 A user who said he was too lazy to subscribe to the list (which is a
22 loss for the list, I think) gave me the tip that passing the kernel
23 the parameter "default_utf8=0" should reverse that behaviour. While
24 the kernel does know the parameter, it did not change the
25 behaviour. But he also said that the command kbd_mode can change the
26 behaviour of the keyboard, and indeed it can:
27
28 kbd_mode -a
29
30 sets the behaviour to single bytes, i.e. the keys send single bytes,
31 while
32
33 kbd_mode -u
34
35 sets it to sending one, two, or three bytes, depending on what UTF-8
36 requires.
37
38 kbd_mode without a parameter outputs the current status, and this is
39 indeed different after booting the two kernels: as expected, for the
40 old kernel, it is "The keyboard is in ASCII mode", for the new one
41 "The keyboard is in Unicode (UTF-8) mode" (the documentation explains
42 that "ASCII" is misleading; it is indeed "single-byte", and fine for
43 all iso-8859- encodings).
44
45 After saying "kbd_mode -a" under the new kernel, I can now produce
46 ISO-8859-1-encoded files with Emacs or the shell. I haven't worked out
47 how to get the screen to display them correctly, however (as it does
48 under the old kernel). The unsubscribed user told me two magic escape
49 sequences, but I have yet to see how to type them correctly. ('ECS (
50 K' to switch to single-byte mode, 'ESC % G' to switch to utf-8
51 mode). "console" covers both keyboard and screen, he
52 explained. (Sounds familiar, but I thought it would not hurt to repeat
53 it here.)
54
55 But still, I am wondering how to get the new kernel to behave as I
56 want out of the box. My best guess is now that this console behaviour
57 has become the default at some point between kernels 2.6.17 and
58 2.6.27, and that you now have to switch it off explicitely. But how?
59
60 Regards,
61 Florian

Replies

Subject Author
[gentoo-user] Re: Kernel update messed up console encoding Nikos Chantziaras <realnc@×××××.de>