comparison src/coding.c @ 90594:a965377e6761

(detect_coding_system): Fix for handling off inhibit_iso_escape_detection. Fix for the case that no coding system is defined for a specific coding category.
author Kenichi Handa <handa@m17n.org>
date Mon, 28 Aug 2006 04:09:02 +0000
parents fe721cfad011
children c358d0861b16
comparison
equal deleted inserted replaced
90593:d6ffdba10de5 90594:a965377e6761
7241 c = *src; 7241 c = *src;
7242 if (c & 0x80) 7242 if (c & 0x80)
7243 break; 7243 break;
7244 if (c < 0x20 7244 if (c < 0x20
7245 && (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO) 7245 && (c == ISO_CODE_ESC || c == ISO_CODE_SI || c == ISO_CODE_SO)
7246 && inhibit_iso_escape_detection) 7246 && ! inhibit_iso_escape_detection)
7247 { 7247 {
7248 coding.head_ascii = src - coding.source; 7248 coding.head_ascii = src - coding.source;
7249 if (detect_coding_iso_2022 (&coding, &detect_info)) 7249 if (detect_coding_iso_2022 (&coding, &detect_info))
7250 { 7250 {
7251 /* We have scanned the whole data. */ 7251 /* We have scanned the whole data. */
7264 if (src == src_end) 7264 if (src == src_end)
7265 /* As all bytes are 7-bit, we can ignore non-ISO-2022 codings. */ 7265 /* As all bytes are 7-bit, we can ignore non-ISO-2022 codings. */
7266 for (i = 0; i < coding_category_raw_text; i++) 7266 for (i = 0; i < coding_category_raw_text; i++)
7267 { 7267 {
7268 category = coding_priorities[i]; 7268 category = coding_priorities[i];
7269 this = coding_categories + category;
7269 if (detect_info.found & (1 << category)) 7270 if (detect_info.found & (1 << category))
7270 break; 7271 break;
7271 } 7272 }
7272 else 7273 else
7273 for (i = 0; i < coding_category_raw_text; i++) 7274 for (i = 0; i < coding_category_raw_text; i++)
7347 category = coding_priorities[i]; 7348 category = coding_priorities[i];
7348 if (! (mask & (1 << category))) 7349 if (! (mask & (1 << category)))
7349 { 7350 {
7350 found |= 1 << category; 7351 found |= 1 << category;
7351 id = coding_categories[category].id; 7352 id = coding_categories[category].id;
7352 val = Fcons (make_number (id), val); 7353 if (id >= 0)
7354 val = Fcons (make_number (id), val);
7353 } 7355 }
7354 } 7356 }
7355 for (i = coding_category_raw_text - 1; i >= 0; i--) 7357 for (i = coding_category_raw_text - 1; i >= 0; i--)
7356 { 7358 {
7357 category = coding_priorities[i]; 7359 category = coding_priorities[i];