… | |
… | |
44 | { "KOI8U", CS_KOI8_U }, |
44 | { "KOI8U", CS_KOI8_U }, |
45 | |
45 | |
46 | { "VISCII*", CS_VISCII }, |
46 | { "VISCII*", CS_VISCII }, |
47 | |
47 | |
48 | { "JISX0201*", CS_JIS0201_1976_0 }, |
48 | { "JISX0201*", CS_JIS0201_1976_0 }, |
49 | { "JISX0208*", CS_JIS0208_1983_0 }, // also wrongly matches -1990-0 (check Encode::JP) |
49 | { "JISX0208*", CS_JIS0208_1990_0 }, // also wrongly matches -1987-0? (check Encode::JP) |
50 | { "JISX0212*", CS_JIS0212_1990_0 }, |
50 | { "JISX0212*", CS_JIS0212_1990_0 }, |
|
|
51 | { "JISX021320001", CS_JIS0213_1 }, |
|
|
52 | { "JISX021320002", CS_JIS0213_2 }, |
51 | { "JISX0221*", CS_UNICODE }, |
53 | { "JISX0221*", CS_UNICODE }, // _very_ close |
52 | |
54 | |
53 | { "KSC5601*", CS_KSC5601_1987_0 }, |
55 | { "KSC5601*", CS_KSC5601_1987_0 }, |
54 | { "KSX1001*", CS_KSC5601_1987_0 }, |
56 | { "KSX1001*", CS_KSC5601_1987_0 }, |
55 | { "KSC5700*", CS_UNICODE }, // unicode plus extensions |
57 | { "KSC5700*", CS_UNICODE }, // unicode plus extensions |
56 | |
58 | |
… | |
… | |
113 | |
115 | |
114 | return CS_UNKNOWN; |
116 | return CS_UNKNOWN; |
115 | } |
117 | } |
116 | |
118 | |
117 | struct rxvt_codeset_conv_unknown : rxvt_codeset_conv { |
119 | struct rxvt_codeset_conv_unknown : rxvt_codeset_conv { |
118 | uint32_t to_unicode (uint32_t enc) const { return NOCHAR; } |
120 | unicode_t to_unicode (uint32_t enc) const { return NOCHAR; } |
119 | uint32_t from_unicode (uint32_t unicode) const { return NOCHAR; } |
121 | uint32_t from_unicode (unicode_t unicode) const { return NOCHAR; } |
120 | } rxvt_codeset_conv_unknown; |
122 | } rxvt_codeset_conv_unknown; |
121 | |
123 | |
122 | struct rxvt_codeset_conv_us_ascii : rxvt_codeset_conv { |
124 | struct rxvt_codeset_conv_us_ascii : rxvt_codeset_conv { |
123 | uint32_t from_unicode (uint32_t unicode) const { return unicode <= 127 ? unicode : NOCHAR; } |
125 | uint32_t from_unicode (unicode_t unicode) const { return unicode <= 127 ? unicode : NOCHAR; } |
124 | } rxvt_codeset_conv_us_ascii; |
126 | } rxvt_codeset_conv_us_ascii; |
125 | |
127 | |
126 | struct rxvt_codeset_conv_unicode : rxvt_codeset_conv { |
128 | struct rxvt_codeset_conv_unicode : rxvt_codeset_conv { |
127 | /* transparent */ |
129 | /* transparent */ |
128 | } rxvt_codeset_conv_unicode; |
130 | } rxvt_codeset_conv_unicode; |
129 | |
131 | |
130 | struct rxvt_codeset_conv_unicode_16 : rxvt_codeset_conv { |
132 | struct rxvt_codeset_conv_unicode_16 : rxvt_codeset_conv { |
131 | uint32_t to_unicode (uint32_t enc) const { return enc; } |
133 | unicode_t to_unicode (uint32_t enc) const { return enc; } |
132 | uint32_t from_unicode (uint32_t unicode) const { return unicode <= 65535 ? unicode : NOCHAR; } |
134 | uint32_t from_unicode (unicode_t unicode) const { return unicode <= 65535 ? unicode : NOCHAR; } |
133 | } rxvt_codeset_conv_unicode_16; |
135 | } rxvt_codeset_conv_unicode_16; |
134 | |
136 | |
135 | #define ENCODING_DEFAULT |
137 | #define ENCODING_DEFAULT |
136 | |
138 | |
137 | #include "table/iso8859_1.h" |
139 | #include "table/iso8859_1.h" |
… | |
… | |
183 | #include "table/viscii.h" |
185 | #include "table/viscii.h" |
184 | |
186 | |
185 | //#define ENCODING_JP |
187 | //#define ENCODING_JP |
186 | |
188 | |
187 | #include "table/jis0201_1976_0.h" |
189 | #include "table/jis0201_1976_0.h" |
188 | #include "table/jis0208_1983_0.h" |
190 | #include "table/jis0208_1990_0.h" |
189 | #include "table/jis0212_1990_0.h" |
191 | #include "table/jis0212_1990_0.h" |
190 | |
192 | |
191 | //#define ENCODING_JP_EXT |
193 | //#define ENCODING_JP_EXT |
192 | |
194 | |
193 | #include "table/jis0213_1.h" |
195 | #include "table/jis0213_1.h" |
… | |
… | |
217 | |
219 | |
218 | &rxvt_codeset_conv_koi8_r, |
220 | &rxvt_codeset_conv_koi8_r, |
219 | &rxvt_codeset_conv_koi8_u, |
221 | &rxvt_codeset_conv_koi8_u, |
220 | |
222 | |
221 | &rxvt_codeset_conv_jis0201_1976_0, |
223 | &rxvt_codeset_conv_jis0201_1976_0, |
222 | &rxvt_codeset_conv_jis0208_1983_0, |
224 | &rxvt_codeset_conv_jis0208_1990_0, |
223 | &rxvt_codeset_conv_jis0212_1990_0, |
225 | &rxvt_codeset_conv_jis0212_1990_0, |
224 | |
226 | |
225 | &rxvt_codeset_conv_jis0213_1, |
227 | &rxvt_codeset_conv_jis0213_1, |
226 | &rxvt_codeset_conv_jis0213_2, |
228 | &rxvt_codeset_conv_jis0213_2, |
227 | |
229 | |
… | |
… | |
245 | |
247 | |
246 | &rxvt_codeset_conv_unicode_16, |
248 | &rxvt_codeset_conv_unicode_16, |
247 | &rxvt_codeset_conv_unicode |
249 | &rxvt_codeset_conv_unicode |
248 | }; |
250 | }; |
249 | |
251 | |
|
|
252 | #if ENABLE_COMBINING |
250 | //#define ENCODING_COMPOSE |
253 | # define ENCODING_COMPOSE |
|
|
254 | #endif |
251 | |
255 | |
252 | #include "table/compose.h" |
256 | #include "table/compose.h" |
253 | |
257 | |
254 | uint32_t |
258 | unicode_t |
255 | rxvt_compose (uint32_t c1, uint32_t c2) |
259 | rxvt_compose (unicode_t c1, unicode_t c2) |
256 | { |
260 | { |
257 | int l = 0; |
261 | int l = 0; |
258 | int r = sizeof (rxvt_compose_table) / sizeof (rxvt_compose_entry) - 1; |
262 | int r = sizeof (rxvt_compose_table) / sizeof (rxvt_compose_entry) - 1; |
259 | int m; |
263 | int m; |
260 | |
264 | |
… | |
… | |
271 | return c.r; |
275 | return c.r; |
272 | } |
276 | } |
273 | |
277 | |
274 | return NOCHAR; |
278 | return NOCHAR; |
275 | } |
279 | } |
|
|
280 | |
|
|
281 | #include "table/category.h" |
|
|
282 | |
|
|
283 | bool unicode::is_space (unicode_t c) |
|
|
284 | { |
|
|
285 | return IS_SPACE (c); |
|
|
286 | } |