From bbe29f1f01eb723811cb8ea1dde00cc0be3a04d3 Mon Sep 17 00:00:00 2001 From: ben Date: Tue, 14 Jan 2003 19:57:36 +0000 Subject: [PATCH] Use the standard linedraw->Unicode mapping from unicode.c to generate unitab_xterm. Most linedraw characters display correctly, but it's clear that RDB and Apple disagree on some of the mappings. git-svn-id: svn://svn.tartarus.org/sgt/putty@2601 cda61777-01e9-0310-a592-d414129be87e --- mac/macucs.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/mac/macucs.c b/mac/macucs.c index e036af53..659f33b9 100644 --- a/mac/macucs.c +++ b/mac/macucs.c @@ -1,4 +1,4 @@ -/* $Id: macucs.c,v 1.4 2003/01/14 19:42:00 ben Exp $ */ +/* $Id: macucs.c,v 1.5 2003/01/14 19:57:36 ben Exp $ */ #include #include @@ -76,6 +76,17 @@ int wc_to_mb(int codepage, int flags, wchar_t *wcstr, int wclen, return ret; /* FIXME: check error codes! */ } +/* Character conversion array, + * the xterm one has the four scanlines that have no unicode 2.0 + * equivalents mapped to their unicode 3.0 locations. + */ +static const wchar_t unitab_xterm_std[32] = { + 0x2666, 0x2592, 0x2409, 0x240c, 0x240d, 0x240a, 0x00b0, 0x00b1, + 0x2424, 0x240b, 0x2518, 0x2510, 0x250c, 0x2514, 0x253c, 0x23ba, + 0x23bb, 0x2500, 0x23bc, 0x23bd, 0x251c, 0x2524, 0x2534, 0x252c, + 0x2502, 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x00b7, 0x0020 +}; + void init_ucs(Session *s) { int i; @@ -87,9 +98,14 @@ void init_ucs(Session *s) else s->ucsdata.unitab_ctrl[i] = 0xFF; - for (i = 0; i < 256; i++) { + for (i = 0; i < 256; i++) s->ucsdata.unitab_line[i] = s->ucsdata.unitab_scoacs[i] = i; - s->ucsdata.unitab_xterm[i] = - (i >= 0x5F && i < 0x7F) ? ((i+1) & 0x1F) : i; - } + + /* VT100 graphics - NB: Broken for non-ascii CP's */ + memcpy(s->ucsdata.unitab_xterm, s->ucsdata.unitab_line, + sizeof(s->ucsdata.unitab_xterm)); + memcpy(s->ucsdata.unitab_xterm + '`', unitab_xterm_std, + sizeof(unitab_xterm_std)); + s->ucsdata.unitab_xterm['_'] = ' '; + } -- 2.11.0