11ab64890Smrg 21ab64890Smrg/* 31ab64890Smrg * ISO-8859-14 41ab64890Smrg */ 51ab64890Smrg 61ab64890Smrgstatic const unsigned short iso8859_14_2uni[96] = { 71ab64890Smrg /* 0xa0 */ 81ab64890Smrg 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, 91ab64890Smrg 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, 101ab64890Smrg /* 0xb0 */ 111ab64890Smrg 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, 121ab64890Smrg 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, 131ab64890Smrg /* 0xc0 */ 141ab64890Smrg 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 151ab64890Smrg 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 161ab64890Smrg /* 0xd0 */ 171ab64890Smrg 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, 181ab64890Smrg 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, 191ab64890Smrg /* 0xe0 */ 201ab64890Smrg 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 211ab64890Smrg 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 221ab64890Smrg /* 0xf0 */ 231ab64890Smrg 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, 241ab64890Smrg 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff, 251ab64890Smrg}; 261ab64890Smrg 271ab64890Smrgstatic int 281ab64890Smrgiso8859_14_mbtowc (conv_t conv, ucs4_t *pwc, const unsigned char *s, int n) 291ab64890Smrg{ 301ab64890Smrg unsigned char c = *s; 311ab64890Smrg if (c >= 0xa0) 321ab64890Smrg *pwc = (ucs4_t) iso8859_14_2uni[c-0xa0]; 331ab64890Smrg else 341ab64890Smrg *pwc = (ucs4_t) c; 351ab64890Smrg return 1; 361ab64890Smrg} 371ab64890Smrg 381ab64890Smrgstatic const unsigned char iso8859_14_page00[96] = { 391ab64890Smrg 0xa0, 0x00, 0x00, 0xa3, 0x00, 0x00, 0x00, 0xa7, /* 0xa0-0xa7 */ 401ab64890Smrg 0x00, 0xa9, 0x00, 0x00, 0x00, 0xad, 0xae, 0x00, /* 0xa8-0xaf */ 411ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x00, /* 0xb0-0xb7 */ 421ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0xb8-0xbf */ 431ab64890Smrg 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, /* 0xc0-0xc7 */ 441ab64890Smrg 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, /* 0xc8-0xcf */ 451ab64890Smrg 0x00, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0x00, /* 0xd0-0xd7 */ 461ab64890Smrg 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0x00, 0xdf, /* 0xd8-0xdf */ 471ab64890Smrg 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, /* 0xe0-0xe7 */ 481ab64890Smrg 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef, /* 0xe8-0xef */ 491ab64890Smrg 0x00, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0x00, /* 0xf0-0xf7 */ 501ab64890Smrg 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0x00, 0xff, /* 0xf8-0xff */ 511ab64890Smrg}; 521ab64890Smrgstatic const unsigned char iso8859_14_page01_0[32] = { 531ab64890Smrg 0x00, 0x00, 0xa4, 0xa5, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 541ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 551ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x18-0x1f */ 561ab64890Smrg 0xb2, 0xb3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 571ab64890Smrg}; 581ab64890Smrgstatic const unsigned char iso8859_14_page01_1[16] = { 591ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0xd0, 0xf0, 0xde, 0xfe, /* 0x70-0x77 */ 601ab64890Smrg 0xaf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 611ab64890Smrg}; 621ab64890Smrgstatic const unsigned char iso8859_14_page1e_0[136] = { 631ab64890Smrg 0x00, 0x00, 0xa1, 0xa2, 0x00, 0x00, 0x00, 0x00, /* 0x00-0x07 */ 641ab64890Smrg 0x00, 0x00, 0xa6, 0xab, 0x00, 0x00, 0x00, 0x00, /* 0x08-0x0f */ 651ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x10-0x17 */ 661ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb0, 0xb1, /* 0x18-0x1f */ 671ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x20-0x27 */ 681ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x28-0x2f */ 691ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x30-0x37 */ 701ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x38-0x3f */ 711ab64890Smrg 0xb4, 0xb5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x40-0x47 */ 721ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x48-0x4f */ 731ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb7, 0xb9, /* 0x50-0x57 */ 741ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x58-0x5f */ 751ab64890Smrg 0xbb, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x60-0x67 */ 761ab64890Smrg 0x00, 0x00, 0xd7, 0xf7, 0x00, 0x00, 0x00, 0x00, /* 0x68-0x6f */ 771ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x70-0x77 */ 781ab64890Smrg 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0x78-0x7f */ 791ab64890Smrg 0xa8, 0xb8, 0xaa, 0xba, 0xbd, 0xbe, 0x00, 0x00, /* 0x80-0x87 */ 801ab64890Smrg}; 811ab64890Smrgstatic const unsigned char iso8859_14_page1e_1[8] = { 821ab64890Smrg 0x00, 0x00, 0xac, 0xbc, 0x00, 0x00, 0x00, 0x00, /* 0xf0-0xf7 */ 831ab64890Smrg}; 841ab64890Smrg 851ab64890Smrgstatic int 861ab64890Smrgiso8859_14_wctomb (conv_t conv, unsigned char *r, ucs4_t wc, int n) 871ab64890Smrg{ 881ab64890Smrg unsigned char c = 0; 891ab64890Smrg if (wc < 0x00a0) { 909c019ec5Smaya *r = (unsigned char) wc; 911ab64890Smrg return 1; 921ab64890Smrg } 931ab64890Smrg else if (wc >= 0x00a0 && wc < 0x0100) 941ab64890Smrg c = iso8859_14_page00[wc-0x00a0]; 951ab64890Smrg else if (wc >= 0x0108 && wc < 0x0128) 961ab64890Smrg c = iso8859_14_page01_0[wc-0x0108]; 971ab64890Smrg else if (wc >= 0x0170 && wc < 0x0180) 981ab64890Smrg c = iso8859_14_page01_1[wc-0x0170]; 991ab64890Smrg else if (wc >= 0x1e00 && wc < 0x1e88) 1001ab64890Smrg c = iso8859_14_page1e_0[wc-0x1e00]; 1011ab64890Smrg else if (wc >= 0x1ef0 && wc < 0x1ef8) 1021ab64890Smrg c = iso8859_14_page1e_1[wc-0x1ef0]; 1031ab64890Smrg if (c != 0) { 1041ab64890Smrg *r = c; 1051ab64890Smrg return 1; 1061ab64890Smrg } 1071ab64890Smrg return RET_ILSEQ; 1081ab64890Smrg} 109