Paul LeoNerd Evans wrote on 2005-06-22 19:15 UTC: > I have been looking at some UTF-8 handling issues in the kernel, and > come upon a bit of a problem. Since I note from the commenting that you > wrote it, I thought it best to send you an email, and see what you > think. > > The core of the issue is that the UTF-8 flag gets swiched off on a > terminal reset. This happens either when a new terminal is started, or > when a reset sequence is sent by the driving application. This causes > issues on system startup, where boot scripts set the UTF-8 mode (using > "unicode_start"), load a keymap, etc... then start mingetty. The latter > first resets the terminal, putting it back in single-character mode. > This is not useful, as now a UTF-8 keymap and font have been loaded, but > the terminal handling is not using UTF-8. Also, screen, vim, irssi, > etc... and in fact most console applications which use the whole screen > send a reset on either start, end, or both. > > As a solution to this, I propose the attached patch to 2.6.11. It > implements a sysctl option, under /proc/sys/vt/utf8_mode, which can be > set to 0 or 1. Its setting determines whether a console gets put into > UTF-8 mode on reset or not. With appropriate prodding at boot time, this > brings the Linux kernel VT inline with other terminal implementations > (e.g. xterm) whose UTF-8ness setting does not change when a terminal > reset sequence is issued. I have been running this patch stably on my > machine for the last month or so, and all seems to work well.
I'd suggest a far simpler and directer approach: With SuSE, Red Hat, Fedora, Ubunto (and from the next major release on perhaps even Debian?) now using UTF-8 by default, the kernel should at each reset simply go directly into UTF-8 mode. End of story. No additional sysctl options etc. ISO 8859 is on its way out. Just make the default UTF-8 flag 1 everywhere. We kept UTF-8 off by default in the mid 1990s only because at the time, UTF-8 was the obscure new experimental thing and we didn't want to interfere with normal ISO 8859 operation. Things have long ago turned the other way round; UTF-8 is now the standard and ISO 2022/ISO 8859 is the legacy mechanism that is only kept for the sake of backwards compatibility. UTF-8 should now be active from boot and after each terminal reset, and anything related to ISO 2022 should be off by default and deactivated by each reset. Markus -- Markus Kuhn, Computer Laboratory, University of Cambridge http://www.cl.cam.ac.uk/~mgk25/ || CB3 0FD, Great Britain -- Linux-UTF8: i18n of Linux on all levels Archive: http://mail.nl.linux.org/linux-utf8/
