another try for linedrawing chars using alternate charsets

This commit is contained in:
Charlie Gordon 2005-05-09 03:24:22 +00:00
commit ff7d6f4c34
2 changed files with 13 additions and 3 deletions

View file

@ -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);

9
tty.c
View file

@ -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);
}