From ff7d6f4c3484422431eb7bfbcd7f229a7800a7d3 Mon Sep 17 00:00:00 2001 From: Charlie Gordon Date: Mon, 9 May 2005 03:24:22 +0000 Subject: [PATCH] another try for linedrawing chars using alternate charsets --- shell.c | 7 +++++-- tty.c | 9 ++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/shell.c b/shell.c index ded62c7..e7597a0 100644 --- a/shell.c +++ b/shell.c @@ -302,11 +302,11 @@ static void tty_emulate(ShellState *s, int c) } break; case 14: - eb_set_charset(s->b, &charset_8859_1); + //eb_set_charset(s->b, &charset_8859_1); s->shifted = 1; break; case 15: - eb_set_charset(s->b, &charset_cp1125); + //eb_set_charset(s->b, &charset_cp1125); s->shifted = 0; break; case 27: @@ -315,6 +315,9 @@ static void tty_emulate(ShellState *s, int c) default: if (c >= 32 || c == 9) { int c1, cur_len, len; + /* CG: horrible kludge for alternate charset support */ + if (s->shifted && c >= 96 && c < 128) + c += 32; /* write char (should factorize with do_char() code */ len = unicode_to_charset(buf1, c, s->b->charset); c1 = eb_nextc(s->b, s->cur_offset, &offset); diff --git a/tty.c b/tty.c index 93a45b6..255f80b 100644 --- a/tty.c +++ b/tty.c @@ -635,9 +635,16 @@ static void term_flush(QEditScreen *s) 30 + fgcolor, 40 + bgcolor); } /* do not display escape codes or invalid codes */ - if (cc < 32 || (cc >= 128 && cc < 128 + 32)) { + if (cc < 32) { buf[0] = '.'; buf[1] = '\0'; + } else + if (cc >= 128 && cc < 128 + 32) { + /* Kludge for linedrawing chars */ + buf[0] = '\016'; + buf[1] = cc - 32; + buf[2] = '\017'; + buf[3] = '\0'; } else { unicode_to_charset(buf, cc, s->charset); }