All of lore.kernel.org
 help / color / mirror / Atom feed
From: Samuel Thibault <samuel.thibault@ens-lyon.org>
To: Willy Tarreau <w@1wt.eu>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: Re: [2.6 patch] UTF-8 fixes in comments
Date: Sun, 4 May 2008 00:50:28 +0100	[thread overview]
Message-ID: <20080503235027.GO8032@implementation> (raw)
In-Reply-To: <20080430194920.GD7501@1wt.eu>

Hello,

Willy Tarreau, le Wed 30 Apr 2008 21:49:20 +0200, a écrit :
> On Wed, Apr 30, 2008 at 01:08:51AM +0100, Samuel Thibault wrote:
> > Willy Tarreau wrote:
> > > 3) if I enter Alt-196, I get a "Ä". Flushing the buffer shows that od
> > > got two bytes: c3 84.
> > 
> > Confirmed.
> > 
> > Try init=/bin/stty -a, that will show
> > 
> > -iutf8
> > 
> > So there is little wonder that canonical mode does not work as expected.
> > 
> > Try init=/bin/sh, from that shell run stty iutf8. Then things will work
> > fine.  The fix is thus just to make the VT's tty initial iutf8 setup
> > follow vt.default_utf8.
> 
> Will try that on a more recent install. Mine's stty does not support
> this option. Your analysis makes quite a lot of sense, and such a fix
> would wipe part of my annoyances/anger with this recent change.

Can you give the patch below a try?
Dynamic per-VT utf-8 switch should also work, provided that you reopen
the VT (i.e. log out).

Samuel



Set IUTF8 as appropriate on VT tty open.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

--- linux/drivers/char/vt.c.orig	2008-05-04 00:37:50.000000000 +0100
+++ linux/drivers/char/vt.c	2008-05-04 00:47:39.000000000 +0100
@@ -2723,6 +2723,10 @@ static int con_open(struct tty_struct *t
 				tty->winsize.ws_row = vc_cons[currcons].d->vc_rows;
 				tty->winsize.ws_col = vc_cons[currcons].d->vc_cols;
 			}
+			if (vc->vc_utf)
+				tty->termios->c_iflag |= IUTF8;
+			else
+				tty->termios->c_iflag &= ~IUTF8;
 			release_console_sem();
 			vcs_make_sysfs(tty);
 			return ret;
@@ -2899,6 +2903,8 @@ int __init vty_init(void)
 	console_driver->minor_start = 1;
 	console_driver->type = TTY_DRIVER_TYPE_CONSOLE;
 	console_driver->init_termios = tty_std_termios;
+	if (default_utf8)
+		console_driver->init_termios.c_iflag |= IUTF8;
 	console_driver->flags = TTY_DRIVER_REAL_RAW | TTY_DRIVER_RESET_TERMIOS;
 	tty_set_operations(console_driver, &con_ops);
 	if (tty_register_driver(console_driver))

  reply	other threads:[~2008-05-03 23:50 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-30  0:08 [2.6 patch] UTF-8 fixes in comments Samuel Thibault
2008-04-30  3:38 ` Chris Adams
2008-04-30  9:38 ` Samuel Thibault
2008-04-30 19:45   ` Willy Tarreau
2008-04-30 19:49 ` Willy Tarreau
2008-05-03 23:50   ` Samuel Thibault [this message]
2008-05-04  8:55     ` Willy Tarreau
2008-05-04 10:25     ` Fix VT canonical input in UTF-8 mode [Was: UTF-8 fixes in comments] Samuel Thibault
2008-05-04 11:03       ` Willy Tarreau
2008-05-05 23:00       ` Andrew Morton
2008-05-05 23:54         ` Samuel Thibault
  -- strict thread matches above, loose matches on Subject: below --
2008-04-28 15:40 [2.6 patch] UTF-8 fixes in comments Adrian Bunk
2008-04-28 23:05 ` Willy Tarreau
2008-04-29  1:29   ` H. Peter Anvin
2008-04-29  5:06     ` Willy Tarreau
2008-04-29  6:04       ` H. Peter Anvin
2008-04-29  7:29       ` Adrian Bunk
2008-04-29  8:14         ` Willy Tarreau
2008-04-29  9:06           ` Helge Hafting
2008-04-29  9:33             ` Alan Cox
2008-04-29 10:09             ` Willy Tarreau
2008-04-29 10:10               ` Alan Cox
2008-04-29 10:33                 ` Willy Tarreau
2008-04-29 10:34                   ` Alan Cox
2008-04-29 22:12                     ` Willy Tarreau
2008-04-29 22:15                       ` Alan Cox
2008-04-29 23:05                         ` Willy Tarreau
2008-05-01 20:18                           ` H. Peter Anvin
2008-05-01  9:46                   ` Alexander E. Patrakov
2008-04-29 19:33                 ` H. Peter Anvin
2008-04-29 10:42               ` Adrian Bunk
2008-04-29 11:06                 ` Willy Tarreau
2008-04-29 11:27                   ` Adrian Bunk
2008-04-29 11:32                     ` Adrian Bunk
2008-04-29 20:18                       ` Jeremy Fitzhardinge
2008-04-30  9:15               ` Helge Hafting
2008-04-30 19:22                 ` Adrian Bunk
2008-04-30 19:42                 ` H. Peter Anvin
2008-04-29  9:43           ` Adrian Bunk
2008-04-29 19:31           ` H. Peter Anvin
2008-04-29 20:05             ` Willy Tarreau
2008-04-29 20:09               ` H. Peter Anvin
2008-05-09 12:48       ` David Kågedal
2008-04-29  9:01   ` Alan Cox
2008-04-29  9:19     ` Jan Engelhardt
2008-04-29  9:34     ` Willy Tarreau
2008-04-29  9:41       ` Alan Cox
2008-04-29 12:18 ` KOSAKI Motohiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080503235027.GO8032@implementation \
    --to=samuel.thibault@ens-lyon.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=w@1wt.eu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.