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
|
@ -70,6 +70,7 @@ HANDLE hStdIn;
|
|||
|
||||
#define RETRY 3
|
||||
|
||||
int eight_bit_clean;
|
||||
int interrupt;
|
||||
int sock;
|
||||
|
||||
|
@ -105,6 +106,7 @@ main(int ac, char **av)
|
|||
char *pname;
|
||||
char *uname;
|
||||
int send_kill = 0;
|
||||
int utf8 = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
err = WSAStartup(0x0101, &WsaData);
|
||||
|
@ -133,6 +135,9 @@ main(int ac, char **av)
|
|||
} else if (strcmp(ptr, "-k") == 0) {
|
||||
send_kill = 1;
|
||||
continue;
|
||||
} else if (strcmp(ptr, "-u") == 0) {
|
||||
utf8 = eight_bit_clean = 1;
|
||||
continue;
|
||||
}
|
||||
argv[j] = argv[i];
|
||||
++j;
|
||||
|
@ -184,7 +189,7 @@ main(int ac, char **av)
|
|||
uname = "nobody";
|
||||
#endif
|
||||
}
|
||||
if (!login(sock, uname, cname, pname, send_kill)) {
|
||||
if (!login(sock, uname, cname, pname, send_kill, utf8)) {
|
||||
close(sock);
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue