comparison src/coding.c @ 21331:4c89837392b3

(CHARSET_OK): Don't reject safe charsets. (DECODE_DESIGNATION): Likewise. (check_composing_code): Likewise.
author Kenichi Handa <handa@m17n.org>
date Thu, 02 Apr 1998 00:25:47 +0000
parents 27b08da98abe
children 388b7c77183b
comparison
equal deleted inserted replaced
21330:146e9f0c310b 21331:4c89837392b3
638 Since these are not standard escape sequences of any ISO, the use 638 Since these are not standard escape sequences of any ISO, the use
639 of them for these meaning is restricted to Emacs only. */ 639 of them for these meaning is restricted to Emacs only. */
640 640
641 enum iso_code_class_type iso_code_class[256]; 641 enum iso_code_class_type iso_code_class[256];
642 642
643 #define CHARSET_OK(idx, charset) \ 643 #define CHARSET_OK(idx, charset) \
644 (CODING_SPEC_ISO_REQUESTED_DESIGNATION \ 644 (coding_system_table[idx]->safe_charsets[charset] \
645 (coding_system_table[idx], charset) \ 645 || (CODING_SPEC_ISO_REQUESTED_DESIGNATION \
646 != CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION) 646 (coding_system_table[idx], charset) \
647 != CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION))
647 648
648 #define SHIFT_OUT_OK(idx) \ 649 #define SHIFT_OUT_OK(idx) \
649 (CODING_SPEC_ISO_INITIAL_DESIGNATION (coding_system_table[idx], 1) >= 0) 650 (CODING_SPEC_ISO_INITIAL_DESIGNATION (coding_system_table[idx], 1) >= 0)
650 651
651 /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions". 652 /* See the above "GENERAL NOTES on `detect_coding_XXX ()' functions".
907 do { \ 908 do { \
908 int charset = ISO_CHARSET_TABLE (make_number (dimension), \ 909 int charset = ISO_CHARSET_TABLE (make_number (dimension), \
909 make_number (chars), \ 910 make_number (chars), \
910 make_number (final_char)); \ 911 make_number (final_char)); \
911 if (charset >= 0 \ 912 if (charset >= 0 \
912 && CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) == reg) \ 913 && (CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) == reg \
914 || coding->safe_charsets[charset])) \
913 { \ 915 { \
914 if (coding->spec.iso2022.last_invalid_designation_register == 0 \ 916 if (coding->spec.iso2022.last_invalid_designation_register == 0 \
915 && reg == 0 \ 917 && reg == 0 \
916 && charset == CHARSET_ASCII) \ 918 && charset == CHARSET_ASCII) \
917 { \ 919 { \
966 if (c >= '(' && c <= '/') 968 if (c >= '(' && c <= '/')
967 { 969 {
968 c1 = *src++; 970 c1 = *src++;
969 if ((c1 < ' ' || c1 >= 0x80) 971 if ((c1 < ' ' || c1 >= 0x80)
970 || (charset = iso_charset_table[dim][c >= ','][c1]) < 0 972 || (charset = iso_charset_table[dim][c >= ','][c1]) < 0
973 || ! coding->safe_charsets[charset]
971 || (CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset) 974 || (CODING_SPEC_ISO_REQUESTED_DESIGNATION (coding, charset)
972 == CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION)) 975 == CODING_SPEC_ISO_NO_REQUESTED_DESIGNATION))
973 invalid_code_found = 1; 976 invalid_code_found = 1;
974 } 977 }
975 else 978 else