… | |
… | |
9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
9 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
10 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
10 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
11 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba |
12 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xba |
13 | }; |
13 | }; |
14 | static const uint16_t iso8859_8_t_0[] = { |
|
|
15 | 0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 0x00a8, 0x00a9, 0x00d7, 0x00ab, |
|
|
16 | 0x00ac, 0x00ad, 0x00ae, 0x00af, 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, |
|
|
17 | 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
|
|
18 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
|
|
19 | 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, |
|
|
20 | 0x0000, 0x0000, 0x0000, 0x2017, 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, |
|
|
21 | 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, 0x05e0, 0x05e1, 0x05e2, 0x05e3, |
|
|
22 | 0x05e4, 0x05e5, 0x05e6, 0x05e7, 0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x200e, 0x200f |
|
|
23 | }; |
|
|
24 | |
14 | |
25 | struct rxvt_codeset_conv_iso8859_8 : rxvt_codeset_conv { |
15 | static uint32_t cs_iso8859_8_from_unicode (unicode_t unicode) { |
26 | uint32_t from_unicode (uint32_t unicode) const { |
|
|
27 | if (unicode <= 0x009f) return unicode; |
16 | if (unicode <= 0x009f) return unicode; |
28 | if (unicode <= 0x05d0 && 0x05ea <= unicode) return unicode - 0x04f0; |
17 | if (unicode <= 0x05d0 && 0x05ea <= unicode) return unicode - 0x04f0; |
29 | if (unicode == 0x200e) return 0x00fd; |
18 | if (unicode == 0x200e) return 0x00fd; |
30 | if (unicode == 0x200f) return 0x00fe; |
19 | if (unicode == 0x200f) return 0x00fe; |
31 | if (unicode == 0x2017) return 0x00df; |
20 | if (unicode == 0x2017) return 0x00df; |
32 | if (0x00a0 <= unicode && unicode <= 0x00f7) |
21 | if (0x00a0 <= unicode && unicode <= 0x00f7) |
33 | return iso8859_8_f_0[unicode - 0x00a0] == 0 ? NOCHAR : iso8859_8_f_0[unicode - 0x00a0]; |
22 | return iso8859_8_f_0[unicode - 0x00a0] == 0 ? NOCHAR : iso8859_8_f_0[unicode - 0x00a0]; |
34 | return NOCHAR; |
23 | return NOCHAR; |
35 | } |
24 | } |
36 | uint32_t to_unicode (uint32_t enc) const { |
|
|
37 | if (enc <= 0x009f) return enc; |
|
|
38 | if (0x00a0 <= enc && enc <= 0x00fe) |
|
|
39 | return iso8859_8_t_0[enc - 0x00a0] == 0 ? NOCHAR : iso8859_8_t_0[enc - 0x00a0]; |
|
|
40 | return NOCHAR; |
|
|
41 | } |
|
|
42 | } rxvt_codeset_conv_iso8859_8; |
|
|
43 | |
25 | |
44 | #else |
26 | #else |
45 | |
27 | |
46 | #define rxvt_codeset_conv_iso8859_8 rxvt_codeset_conv_unknown |
28 | #define cs_iso8859_8_from_unicode cs_unknown_from_unicode |
|
|
29 | #define cs_iso8859_8_to_unicode cs_unknown_to_unicode |
47 | |
30 | |
48 | #endif |
31 | #endif |