comparison src/mule-charset.c @ 359:8e84bee8ddd0 r21-1-9

Import from CVS: tag r21-1-9
author cvs
date Mon, 13 Aug 2007 10:57:55 +0200
parents 7c94d56991e1
children a4f53d9b3154
comparison
equal deleted inserted replaced
358:fed6e0f6a03a 359:8e84bee8ddd0
249 f3 = CHAR_FIELD3 (ch); 249 f3 = CHAR_FIELD3 (ch);
250 250
251 if (f1 == 0) 251 if (f1 == 0)
252 { 252 {
253 Lisp_Object charset; 253 Lisp_Object charset;
254 254 /* 0x8B checking is here to avoid the gap between
255 LEADING_BYTE_LATIN_JISX0201 and
256 LEADING_BYTE_CYRILLIC_ISO8859_5. See mule-charset.h */
255 if (f2 < MIN_CHAR_FIELD2_OFFICIAL || 257 if (f2 < MIN_CHAR_FIELD2_OFFICIAL ||
258 f2 == (0x8B - FIELD2_TO_OFFICIAL_LEADING_BYTE) ||
256 (f2 > MAX_CHAR_FIELD2_OFFICIAL && f2 < MIN_CHAR_FIELD2_PRIVATE) || 259 (f2 > MAX_CHAR_FIELD2_OFFICIAL && f2 < MIN_CHAR_FIELD2_PRIVATE) ||
257 f2 > MAX_CHAR_FIELD2_PRIVATE) 260 f2 > MAX_CHAR_FIELD2_PRIVATE)
258 return 0; 261 return 0;
259 if (f3 < 0x20) 262 if (f3 < 0x20)
260 return 0; 263 return 0;
261 264
262 if (f3 != 0x20 && f3 != 0x7F) 265 if (f3 != 0x20 && f3 != 0x7F && !(f2 >= MIN_CHAR_FIELD2_PRIVATE &&
266 f2 <= MAX_CHAR_FIELD2_PRIVATE))
263 return 1; 267 return 1;
264 268
265 /* 269 /*
266 NOTE: This takes advantage of the fact that 270 NOTE: This takes advantage of the fact that
267 FIELD2_TO_OFFICIAL_LEADING_BYTE and 271 FIELD2_TO_OFFICIAL_LEADING_BYTE and
268 FIELD2_TO_PRIVATE_LEADING_BYTE are the same. 272 FIELD2_TO_PRIVATE_LEADING_BYTE are the same.
269 */ 273 */
270 charset = CHARSET_BY_LEADING_BYTE (f2 + FIELD2_TO_OFFICIAL_LEADING_BYTE); 274 charset = CHARSET_BY_LEADING_BYTE (f2 + FIELD2_TO_OFFICIAL_LEADING_BYTE);
275 if (EQ (charset, Qnil))
276 return 0;
271 return (XCHARSET_CHARS (charset) == 96); 277 return (XCHARSET_CHARS (charset) == 96);
272 } 278 }
273 else 279 else
274 { 280 {
275 Lisp_Object charset; 281 Lisp_Object charset;
291 return 0; 297 return 0;
292 return 1; 298 return 1;
293 } 299 }
294 #endif /* ENABLE_COMPOSITE_CHARS */ 300 #endif /* ENABLE_COMPOSITE_CHARS */
295 301
296 if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F) 302 if (f2 != 0x20 && f2 != 0x7F && f3 != 0x20 && f3 != 0x7F
303 && !(f1 >= MIN_CHAR_FIELD1_PRIVATE && f1 <= MAX_CHAR_FIELD1_PRIVATE))
297 return 1; 304 return 1;
298 305
299 if (f1 <= MAX_CHAR_FIELD1_OFFICIAL) 306 if (f1 <= MAX_CHAR_FIELD1_OFFICIAL)
300 charset = 307 charset =
301 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_OFFICIAL_LEADING_BYTE); 308 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_OFFICIAL_LEADING_BYTE);
302 else 309 else
303 charset = 310 charset =
304 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_PRIVATE_LEADING_BYTE); 311 CHARSET_BY_LEADING_BYTE (f1 + FIELD1_TO_PRIVATE_LEADING_BYTE);
305 312
313 if (EQ (charset, Qnil))
314 return 0;
306 return (XCHARSET_CHARS (charset) == 96); 315 return (XCHARSET_CHARS (charset) == 96);
307 } 316 }
308 } 317 }
309 318
310 319