Fwd: Linux console, selection + non-ascii + setfont

Alessandro Rubini (rubini@pop.systemy.it)
Tue, 3 Mar 1998 15:16:22 +0100 (MET)


Hello all.
I received this message from Sergei Ivanov, about a gpm problem.

I had many reports of similar problems, but since I didn't experience
it myself have never been able to track them down. The patch he's
proposing looks good, although I had no time to try it out.

This message is sent to linux-kernel and Andries Brower, the kbd
mantainer (who's not reading linux-kernel).

Best
/alessandro

> From: Sergei Ivanov <svivanov@pdmi.ras.ru>
> Subject: Linux console, selection + non-ascii + setfont
> To: rubini@ipvvis.unipv.it
> Date: Sun, 1 Mar 1998 03:31:18 +0000 ()
>
> This is a bug report (and a quick fix) for the selection code in
> Linux 2.0.33.
>
> I have kbd-0.93 and gpm-1.12 installed. My init scripts do `setfont
> Cyr_a8x16' (loading Cyrillic Alternative font) and start gpm. I
> take a file containing some Cyrillic text, load it into an editor
> that displays 8-bit codes as-is, select some text with the mouse,
> and paste the selection. It inserts something, but many Cyrillic
> letters appears replaced by other letters or graphics characters.
>
> This has nothing to do with non-inversibility of the
> character-to-glyph mapping, because in my case the mapping is
> one-to-one (in fact, trivial); and anyway the glyphs should remain
> the same after cut and paste unless they cannot be output at all.
>
> After realizing that gpm does not translate characters, I looked
> through the files console.c, consolemap.c, and selection.c in
> /usr/src/linux-2.0.33/drivers/char/. I found that `con_set_font()'
> sets the variable `hashtable_contents_valid' to 0, and this seems to
> make the character-to-glyph mapping trivial. But it does not update
> the inverse translation tables, on which `inverse_translate()',
> called by `set_selection()', depends.
>
> I won't bet the above is the true origin of the problem, but
> everything got fixed with the following patch, which I believe is
> equivalent to having inverse translation tables updated.

-------------------------------------------------------------------

--- consolemap.c.orig Sat Jun 8 13:14:39 1996
+++ consolemap.c Sat Feb 28 23:52:59 1998
@@ -210,6 +210,8 @@
unsigned char inverse_translate(int glyph) {
if ( glyph < 0 || glyph >= MAX_GLYPH )
return 0;
+ else if (!hashtable_contents_valid)
+ return (unsigned char)(glyph & 0xff);
else
return ((inv_translate && inv_translate[glyph])
? inv_translate[glyph]

-------------------------------------------------------------------

>
> Thanks,
>
> Sergei Ivanov
> <svivanov@pdmi.ras.ru>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu