aboutsummaryrefslogtreecommitdiffstats
path: root/src/coding.c
diff options
context:
space:
mode:
authorKenichi Handa2008-10-21 02:28:20 +0000
committerKenichi Handa2008-10-21 02:28:20 +0000
commit0729571314c28b9ee6669c6850a7e99f75964c98 (patch)
treeba632537a3b0195c067a80f0c72568944faac152 /src/coding.c
parent30ee26a9592a7784acccbc8a86e3060d5f1eca78 (diff)
downloademacs-0729571314c28b9ee6669c6850a7e99f75964c98.tar.gz
emacs-0729571314c28b9ee6669c6850a7e99f75964c98.zip
(detect_coding_charset): For iso-8859-* coding systems,
check Vlatin_extra_code_table.
Diffstat (limited to 'src/coding.c')
-rw-r--r--src/coding.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/coding.c b/src/coding.c
index f7722f3212b..fb0bfa0b15c 100644
--- a/src/coding.c
+++ b/src/coding.c
@@ -4975,16 +4975,20 @@ detect_coding_charset (coding, detect_info)
4975 const unsigned char *src_end = coding->source + coding->src_bytes; 4975 const unsigned char *src_end = coding->source + coding->src_bytes;
4976 int multibytep = coding->src_multibyte; 4976 int multibytep = coding->src_multibyte;
4977 int consumed_chars = 0; 4977 int consumed_chars = 0;
4978 Lisp_Object attrs, valids; 4978 Lisp_Object attrs, valids, name;
4979 int found = 0; 4979 int found = 0;
4980 int head_ascii = coding->head_ascii; 4980 int head_ascii = coding->head_ascii;
4981 int check_latin_extra = 0;
4981 4982
4982 detect_info->checked |= CATEGORY_MASK_CHARSET; 4983 detect_info->checked |= CATEGORY_MASK_CHARSET;
4983 4984
4984 coding = &coding_categories[coding_category_charset]; 4985 coding = &coding_categories[coding_category_charset];
4985 attrs = CODING_ID_ATTRS (coding->id); 4986 attrs = CODING_ID_ATTRS (coding->id);
4986 valids = AREF (attrs, coding_attr_charset_valids); 4987 valids = AREF (attrs, coding_attr_charset_valids);
4987 4988 name = CODING_ID_NAME (coding->id);
4989 if (VECTORP (Vlatin_extra_code_table)
4990 && strcmp ((char *) SDATA (SYMBOL_NAME (name)), "iso-8859-"))
4991 check_latin_extra = 1;
4988 if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs))) 4992 if (! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
4989 src += head_ascii; 4993 src += head_ascii;
4990 4994
@@ -5003,7 +5007,13 @@ detect_coding_charset (coding, detect_info)
5003 if (NILP (val)) 5007 if (NILP (val))
5004 break; 5008 break;
5005 if (c >= 0x80) 5009 if (c >= 0x80)
5006 found = CATEGORY_MASK_CHARSET; 5010 {
5011 if (c < 0xA0
5012 && check_latin_extra
5013 && NILP (XVECTOR (Vlatin_extra_code_table)->contents[c]))
5014 break;
5015 found = CATEGORY_MASK_CHARSET;
5016 }
5007 if (INTEGERP (val)) 5017 if (INTEGERP (val))
5008 { 5018 {
5009 charset = CHARSET_FROM_ID (XFASTINT (val)); 5019 charset = CHARSET_FROM_ID (XFASTINT (val));