Client UTF-8 support.
(login): New parameter utf8. If set, request option utf-8 from server. (expect, recvline): Split recvline() out of expect(). Replace or remove some unhelpful diagnostics. (eight_bit_clean): New. (screen): If eight_bit_clean is set, highlighting is switched with SO/SI. Else characters with MSB set are highlighted. (main): New option -u to request UTF-8 and set eight_bit_clean.
This commit is contained in:
parent
baf416652a
commit
7ef7aa83b8
6 changed files with 55 additions and 16 deletions
|
@ -344,11 +344,15 @@ screen(char *buf)
|
|||
char c;
|
||||
|
||||
while ((c = *buf++)) {
|
||||
if (c & 0x80) {
|
||||
for (sop = SO; putc(*sop, stdout); sop++) ;
|
||||
(void)putc(c & 0x7f, stdout);
|
||||
for (sop = SE; putc(*sop, stdout); sop++) ;
|
||||
if (eight_bit_clean) {
|
||||
if (c == 14) fputs(SO, stdout);
|
||||
else if (c == 15) fputs(SE, stdout);
|
||||
else putchar(c);
|
||||
} else if (c & 0x80) {
|
||||
fputs(SO, stdout);
|
||||
putchar(c & 0x7f);
|
||||
fputs(SE, stdout);
|
||||
} else
|
||||
(void)putc(c, stdout);
|
||||
putchar(c);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue