updates KOI8-R (RFC 1489), adds KOI8-U per (RFC 2319). Reference: /n/sources/patch/koi8 Date: Fri Apr 4 11:37:09 CES 2014 Signed-off-by: yarikos@gmail.com --- /sys/src/cmd/tcs/tcs.c Fri Apr 4 11:36:27 2014 +++ /sys/src/cmd/tcs/tcs.c Fri Apr 4 11:36:18 2014 @@ -541,8 +541,9 @@ { "jis", "guesses at the JIS encoding", From|Func, 0, (Fnptr)jis_in }, { "jis-kanji", "ISO 2022-JP (Japanese)", From|Func, 0, (Fnptr)jisjis_in }, { "jis-kanji", "ISO 2022-JP (Japanese)", Func, 0, (Fnptr)jisjis_out }, - { "koi8", "KOI-8 (GOST 19769-74)", Table, (void *)tabkoi8 }, + { "koi8", "KOI-8 (RFC 1489)", Table, (void *)tabkoi8 }, { "koi8-r", "alias for koi8 (MIME)", Table, (void *)tabkoi8 }, + { "koi8-u", "KOI8 Ukrainian (RFC 2319)", Table, (void *)tabkoi8u }, { "latin1", "alias for 8859-1", Table, (void *)tab8859_1 }, { "macrom", "Macintosh Standard Roman character set", Table, (void *)tabmacroman }, { "microsoft", "alias for windows1252", Table, (void *)tabcp1252 }, --- /sys/src/cmd/tcs/cyrillic.h Fri Apr 4 11:36:42 2014 +++ /sys/src/cmd/tcs/cyrillic.h Fri Apr 4 11:36:36 2014 @@ -35,14 +35,41 @@ 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f, 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, +0x2500,0x2502,0x250c,0x2510,0x2514,0x2518,0x251c,0x2524, +0x252c,0x2534,0x253c,0x2580,0x2584,0x2588,0x258c,0x2590, +0x2591,0x2592,0x2593,0x2320,0x25a0,0x2219,0x221a,0x2248, +0x2264,0x2265,0x00a0,0x2321,0x00b0,0x00b2,0x00b7,0x00f7, +0x2550,0x2551,0x2552,0x0451,0x2553,0x2554,0x2555,0x2556, +0x2557,0x2558,0x2559,0x255a,0x255b,0x255c,0x255d,0x255e, +0x255f,0x2560,0x2561,0x0401,0x2562,0x2563,0x2564,0x2565, +0x2566,0x2567,0x2568,0x2569,0x256a,0x256b,0x256c,0x00a9, +0x044e,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, +0x0445,0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e, +0x043f,0x044f,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432, +0x044c,0x044b,0x0437,0x0448,0x044d,0x0449,0x0447,0x044a, +0x042e,0x0410,0x0411,0x0426,0x0414,0x0415,0x0424,0x0413, +0x0425,0x0418,0x0419,0x041a,0x041b,0x041c,0x041d,0x041e, +0x041f,0x042f,0x0420,0x0421,0x0422,0x0423,0x0416,0x0412, +0x042c,0x042b,0x0417,0x0428,0x042d,0x0429,0x0427,0x042a, +}; +long tabkoi8u[256] = +{ +0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f, +0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f, +0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f, +0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f, +0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f, +0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f, +0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f, +0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f, +0x2500,0x2502,0x250c,0x2510,0x2514,0x2518,0x251c,0x2524, +0x252c,0x2534,0x253c,0x2580,0x2584,0x2588,0x258c,0x2590, +0x2591,0x2592,0x2593,0x2320,0x25a0,0x2219,0x221a,0x2248, +0x2264,0x2265,0x00a0,0x2321,0x00b0,0x00b2,0x00b7,0x00f7, +0x2550,0x2551,0x2552,0x0451,0x0454,0x2554,0x0456,0x0457, +0x2557,0x2558,0x2559,0x255a,0x255b,0x0491,0x255d,0x255e, +0x255f,0x2560,0x2561,0x0401,0x0403,0x2563,0x0406,0x0407, +0x2566,0x2567,0x2568,0x2569,0x256a,0x0490,0x256c,0x00a9, 0x044e,0x0430,0x0431,0x0446,0x0434,0x0435,0x0444,0x0433, 0x0445,0x0438,0x0439,0x043a,0x043b,0x043c,0x043d,0x043e, 0x043f,0x044f,0x0440,0x0441,0x0442,0x0443,0x0436,0x0432,