X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/bc9f5888ee55c558b42a1c61acad963eba11616e..8772ac697da9af645ce4ce9d73b6406f7d126f49:/unicode.c?ds=sidebyside diff --git a/unicode.c b/unicode.c index eec551ea..3c25c6ea 100644 --- a/unicode.c +++ b/unicode.c @@ -32,7 +32,7 @@ static const WCHAR unitab_xterm_std[32] = { */ /* - * Tables for ISO-8859-{1-9,13-16} derived from those downloaded + * Tables for ISO-8859-{1-10,13-16} derived from those downloaded * 2001-10-02 from -- jtn * Table for ISO-8859-11 derived from same on 2002-11-18. -- bjh21 */ @@ -183,15 +183,12 @@ static const wchar_t iso_8859_9[] = { 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF }; -/* ISO 8859-10:1993? (Latin-6, "Nordic" [Sami, Inuit, Icelandic]) */ -/* Translation table from RDB. unicode.org (ISO/IEC 8859-10:1998) has - * U+2015 (HORIZONTAL BAR) at codepoint 0xBD instead - * (U+2014 is EM DASH). -- jtn */ +/* ISO/IEC 8859-10:1998 (Latin-6, "Nordic" [Sami, Inuit, Icelandic]) */ static const wchar_t iso_8859_10[] = { 0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7, 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A, 0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7, - 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2014, 0x016B, 0x014B, + 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2015, 0x016B, 0x014B, 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E, 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF, 0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168, @@ -383,7 +380,7 @@ static const struct cp_list_item cp_list[] = { {"ISO-8859-7:1987 (Latin/Greek)", 0, 96, iso_8859_7}, {"ISO-8859-8:1999 (Latin/Hebrew)", 0, 96, iso_8859_8}, {"ISO-8859-9:1999 (Latin-5, Turkish)", 0, 96, iso_8859_9}, - {"ISO-8859-10:1993 (Latin-6, Nordic)", 0, 96, iso_8859_10}, + {"ISO-8859-10:1998 (Latin-6, Nordic)", 0, 96, iso_8859_10}, {"ISO-8859-11:2001 (Latin/Thai)", 0, 96, iso_8859_11}, {"ISO-8859-13:1998 (Latin-7, Baltic)", 0, 96, iso_8859_13}, {"ISO-8859-14:1998 (Latin-8, Celtic)", 0, 96, iso_8859_14}, @@ -419,7 +416,7 @@ static const struct cp_list_item cp_list[] = { static void link_font(WCHAR * line_tbl, WCHAR * font_tbl, WCHAR attr); -void init_ucs(void) +void init_ucs(Config *cfg) { int i, j; int used_dtf = 0; @@ -429,14 +426,14 @@ void init_ucs(void) tbuf[i] = i; /* Decide on the Line and Font codepages */ - line_codepage = decode_codepage(cfg.line_codepage); + line_codepage = decode_codepage(cfg->line_codepage); if (font_codepage <= 0) { font_codepage=0; dbcs_screenfont=0; } - if (cfg.vtmode == VT_OEMONLY) { + if (cfg->vtmode == VT_OEMONLY) { font_codepage = 437; dbcs_screenfont = 0; if (line_codepage <= 0) @@ -456,7 +453,7 @@ void init_ucs(void) if (font_codepage == 437) unitab_font[0] = unitab_font[255] = 0xFFFF; } - if (cfg.vtmode == VT_XWINDOWS) + if (cfg->vtmode == VT_XWINDOWS) memcpy(unitab_font + 1, unitab_xterm_std, sizeof(unitab_xterm_std)); @@ -464,14 +461,14 @@ void init_ucs(void) get_unitab(CP_OEMCP, unitab_oemcp, 1); /* Collect CP437 ucs table for SCO acs */ - if (cfg.vtmode == VT_OEMANSI || cfg.vtmode == VT_XWINDOWS) + if (cfg->vtmode == VT_OEMANSI || cfg->vtmode == VT_XWINDOWS) memcpy(unitab_scoacs, unitab_oemcp, sizeof(unitab_scoacs)); else get_unitab(437, unitab_scoacs, 1); /* Collect line set ucs table */ if (line_codepage == font_codepage && - (dbcs_screenfont || cfg.vtmode == VT_POORMAN || font_codepage==0)) { + (dbcs_screenfont || cfg->vtmode == VT_POORMAN || font_codepage==0)) { /* For DBCS and POOR fonts force direct to font */ used_dtf = 1; @@ -538,14 +535,14 @@ void init_ucs(void) unitab_ctrl[i] = 0xFF; /* Generate line->screen direct conversion links. */ - if (cfg.vtmode == VT_OEMANSI || cfg.vtmode == VT_XWINDOWS) + if (cfg->vtmode == VT_OEMANSI || cfg->vtmode == VT_XWINDOWS) link_font(unitab_scoacs, unitab_oemcp, ATTR_OEMCP); link_font(unitab_line, unitab_font, ATTR_ACP); link_font(unitab_scoacs, unitab_font, ATTR_ACP); link_font(unitab_xterm, unitab_font, ATTR_ACP); - if (cfg.vtmode == VT_OEMANSI || cfg.vtmode == VT_XWINDOWS) { + if (cfg->vtmode == VT_OEMANSI || cfg->vtmode == VT_XWINDOWS) { link_font(unitab_line, unitab_oemcp, ATTR_OEMCP); link_font(unitab_xterm, unitab_oemcp, ATTR_OEMCP); } @@ -558,7 +555,7 @@ void init_ucs(void) } /* Last chance, if !unicode then try poorman links. */ - if (cfg.vtmode != VT_UNICODE) { + if (cfg->vtmode != VT_UNICODE) { static char poorman_scoacs[] = "CueaaaaceeeiiiAAE**ooouuyOUc$YPsaiounNao?++**!<>###||||++||++++++--|-+||++--|-+----++++++++##||#aBTPEsyt******EN=+><++-=... n2* "; static char poorman_latin1[] =