… | |
… | |
26 | { "ISO885914", CS_ISO8859_14 }, |
26 | { "ISO885914", CS_ISO8859_14 }, |
27 | { "ISO885915", CS_ISO8859_15 }, |
27 | { "ISO885915", CS_ISO8859_15 }, |
28 | { "FCD885915", CS_ISO8859_15 }, |
28 | { "FCD885915", CS_ISO8859_15 }, |
29 | { "ISO885916", CS_ISO8859_16 }, |
29 | { "ISO885916", CS_ISO8859_16 }, |
30 | |
30 | |
|
|
31 | { "TIS620*", CS_ISO8859_11 }, // close enough |
|
|
32 | |
31 | { "ISO10646*", CS_UNICODE }, |
33 | { "ISO10646*", CS_UNICODE }, |
32 | { "UNICODE", CS_UNICODE }, |
34 | { "UNICODE", CS_UNICODE }, |
33 | { "UTF8", CS_UNICODE }, |
35 | { "UTF8", CS_UNICODE }, |
34 | |
36 | |
35 | { "ASCII", CS_US_ASCII }, |
37 | { "ASCII", CS_US_ASCII }, |
… | |
… | |
40 | { "GOST1976874*", CS_KOI8_R }, |
42 | { "GOST1976874*", CS_KOI8_R }, |
41 | { "KOI8RU", CS_KOI8_U }, |
43 | { "KOI8RU", CS_KOI8_U }, |
42 | { "KOI8U", CS_KOI8_U }, |
44 | { "KOI8U", CS_KOI8_U }, |
43 | |
45 | |
44 | { "VISCII*", CS_VISCII }, |
46 | { "VISCII*", CS_VISCII }, |
45 | { "TIS62025291", CS_VISCII }, // close enough |
|
|
46 | |
47 | |
47 | { "JISX0201*", CS_JIS0201_1976_0 }, |
48 | { "JISX0201*", CS_JIS0201_1976_0 }, |
48 | { "JISX0208*", CS_JIS0208_1983_0 }, // also wrongly matches -1990-0 (check Encode::JP) |
49 | { "JISX0208*", CS_JIS0208_1983_0 }, // also wrongly matches -1990-0 (check Encode::JP) |
49 | { "JISX0212*", CS_JIS0212_1990_0 }, |
50 | { "JISX0212*", CS_JIS0212_1990_0 }, |
50 | { "JISX0221*", CS_UNICODE }, |
51 | { "JISX0221*", CS_UNICODE }, |
… | |
… | |
129 | struct rxvt_codeset_conv_unicode_16 : rxvt_codeset_conv { |
130 | struct rxvt_codeset_conv_unicode_16 : rxvt_codeset_conv { |
130 | uint32_t to_unicode (uint32_t enc) const { return enc; } |
131 | uint32_t to_unicode (uint32_t enc) const { return enc; } |
131 | uint32_t from_unicode (uint32_t unicode) const { return unicode <= 65535 ? unicode : NOCHAR; } |
132 | uint32_t from_unicode (uint32_t unicode) const { return unicode <= 65535 ? unicode : NOCHAR; } |
132 | } rxvt_codeset_conv_unicode_16; |
133 | } rxvt_codeset_conv_unicode_16; |
133 | |
134 | |
134 | /* block character set, must conform to the dec special pseudofont in defaultfont.C */ |
|
|
135 | struct rxvt_codeset_conv_special : rxvt_codeset_conv { |
|
|
136 | uint32_t to_unicode (uint32_t enc) const { |
|
|
137 | return enc; |
|
|
138 | } |
|
|
139 | |
|
|
140 | uint32_t from_unicode (uint32_t unicode) const { |
|
|
141 | return unicode; |
|
|
142 | } |
|
|
143 | } rxvt_codeset_conv_special; |
|
|
144 | |
|
|
145 | #define ENCODING_DEFAULT |
135 | #define ENCODING_DEFAULT |
146 | |
136 | |
147 | #include "table/iso8859_1.h" |
137 | #include "table/iso8859_1.h" |
148 | #include "table/iso8859_15.h" |
138 | #include "table/iso8859_15.h" |
149 | |
139 | |
… | |
… | |
204 | #include "table/jis0213_2.h" |
194 | #include "table/jis0213_2.h" |
205 | |
195 | |
206 | // order must match table in encoding.h(!) |
196 | // order must match table in encoding.h(!) |
207 | const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS] = { |
197 | const rxvt_codeset_conv *rxvt_codeset[NUM_CODESETS] = { |
208 | &rxvt_codeset_conv_unknown, |
198 | &rxvt_codeset_conv_unknown, |
209 | &rxvt_codeset_conv_special, |
|
|
210 | |
199 | |
211 | &rxvt_codeset_conv_us_ascii, |
200 | &rxvt_codeset_conv_us_ascii, |
212 | |
201 | |
213 | &rxvt_codeset_conv_iso8859_1, |
202 | &rxvt_codeset_conv_iso8859_1, |
214 | &rxvt_codeset_conv_iso8859_2, |
203 | &rxvt_codeset_conv_iso8859_2, |
… | |
… | |
256 | |
245 | |
257 | &rxvt_codeset_conv_unicode_16, |
246 | &rxvt_codeset_conv_unicode_16, |
258 | &rxvt_codeset_conv_unicode |
247 | &rxvt_codeset_conv_unicode |
259 | }; |
248 | }; |
260 | |
249 | |
|
|
250 | #if ENABLE_COMBINING |
|
|
251 | # define ENCODING_COMPOSE |
|
|
252 | #endif |
|
|
253 | |
|
|
254 | #include "table/compose.h" |
|
|
255 | |
|
|
256 | uint32_t |
|
|
257 | rxvt_compose (uint32_t c1, uint32_t c2) |
|
|
258 | { |
|
|
259 | int l = 0; |
|
|
260 | int r = sizeof (rxvt_compose_table) / sizeof (rxvt_compose_entry) - 1; |
|
|
261 | int m; |
|
|
262 | |
|
|
263 | while (r > l) |
|
|
264 | { |
|
|
265 | m = (l + r) / 2; |
|
|
266 | rxvt_compose_entry &c = rxvt_compose_table[m]; |
|
|
267 | |
|
|
268 | if (c.c1 < c1 || (c.c1 == c1 && c.c2 < c2)) |
|
|
269 | l = m + 1; |
|
|
270 | else if (c.c1 > c1 || (c.c1 == c1 && c.c2 > c2)) |
|
|
271 | r = m - 1; |
|
|
272 | else |
|
|
273 | return c.r; |
|
|
274 | } |
|
|
275 | |
|
|
276 | return NOCHAR; |
|
|
277 | } |