/* Header for code conversion stuff
Copyright (C) 1991, 1995 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
/* Header for code conversion stuff
Copyright (C) 1991, 1995 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
CODESYS_ISO2022, /* Any ISO2022-compliant coding system.
Includes JIS, EUC, CTEXT */
CODESYS_BIG5, /* BIG5 (used for Taiwanese). */
CODESYS_ISO2022, /* Any ISO2022-compliant coding system.
Includes JIS, EUC, CTEXT */
CODESYS_BIG5, /* BIG5 (used for Taiwanese). */
+ CODESYS_UCS4, /* ISO 10646 UCS-4 */
+ CODESYS_UTF8, /* ISO 10646 UTF-8 */
+#ifdef UTF2000
+ CODESYS_UTF16, /* ISO 10646 UTF-16 */
+#endif
CODESYS_CCL, /* Converter written in CCL. */
#endif
CODESYS_NO_CONVERSION /* "No conversion"; used for binary files.
CODESYS_CCL, /* Converter written in CCL. */
#endif
CODESYS_NO_CONVERSION /* "No conversion"; used for binary files.
/* This is the major type of the coding system -- one of Big5, ISO2022,
Shift-JIS, etc. See the constants above. */
/* This is the major type of the coding system -- one of Big5, ISO2022,
Shift-JIS, etc. See the constants above. */
/* Subsidiary coding systems that specify a particular type of EOL
marking, rather than autodetecting it. These will only be non-nil
if (eol_type == EOL_AUTODETECT). */
/* Subsidiary coding systems that specify a particular type of EOL
marking, rather than autodetecting it. These will only be non-nil
if (eol_type == EOL_AUTODETECT). */
{
/* For a CCL coding system, these specify the CCL programs used for
decoding (input) and encoding (output). */
{
/* For a CCL coding system, these specify the CCL programs used for
decoding (input) and encoding (output). */
-DECLARE_LRECORD (coding_system, struct Lisp_Coding_System);
-#define XCODING_SYSTEM(x) XRECORD (x, coding_system, struct Lisp_Coding_System)
+DECLARE_LRECORD (coding_system, Lisp_Coding_System);
+#define XCODING_SYSTEM(x) XRECORD (x, coding_system, Lisp_Coding_System)
#define XSETCODING_SYSTEM(x, p) XSETRECORD (x, p, coding_system)
#define CODING_SYSTEMP(x) RECORDP (x, coding_system)
#define XSETCODING_SYSTEM(x, p) XSETRECORD (x, p, coding_system)
#define CODING_SYSTEMP(x) RECORDP (x, coding_system)
#define CHECK_CODING_SYSTEM(x) CHECK_RECORD (x, coding_system)
#define CONCHECK_CODING_SYSTEM(x) CONCHECK_RECORD (x, coding_system)
#define CHECK_CODING_SYSTEM(x) CHECK_RECORD (x, coding_system)
#define CONCHECK_CODING_SYSTEM(x) CONCHECK_RECORD (x, coding_system)
#define CODING_SYSTEM_CCL_DECODE(codesys) ((codesys)->ccl.decode)
#define CODING_SYSTEM_CCL_ENCODE(codesys) ((codesys)->ccl.encode)
#endif /* MULE */
#define CODING_SYSTEM_CCL_DECODE(codesys) ((codesys)->ccl.decode)
#define CODING_SYSTEM_CCL_ENCODE(codesys) ((codesys)->ccl.encode)
#endif /* MULE */
+#ifdef UTF2000
+#define CODING_SYSTEM_DISABLE_COMPOSITION(codesys) \
+ ((codesys)->disable_composition)
+#define CODING_SYSTEM_ENABLE_DECOMPOSITION(codesys) \
+ ((codesys)->enable_decomposition)
+#define CODING_SYSTEM_USE_ENTITY_REFERENCE(codesys) \
+ ((codesys)->use_entity_reference)
+#define CODING_SYSTEM_CCS_PRIORITY_LIST(codesys) \
+ ((codesys)->ccs_priority_list)
+#endif
+#ifdef UTF2000
+#define XCODING_SYSTEM_DISABLE_COMPOSITION(codesys) \
+ CODING_SYSTEM_DISABLE_COMPOSITION (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_ENABLE_DECOMPOSITION(codesys) \
+ CODING_SYSTEM_ENABLE_DECOMPOSITION (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_USE_ENTITY_REFERENCE(codesys) \
+ CODING_SYSTEM_USE_ENTITY_REFERENCE (XCODING_SYSTEM (codesys))
+#define XCODING_SYSTEM_CCS_PRIORITY_LIST(codesys) \
+ CODING_SYSTEM_CCS_PRIORITY_LIST (XCODING_SYSTEM (codesys))
+#endif
EXFUN (Fcoding_category_list, 0);
EXFUN (Fcoding_category_system, 1);
EXFUN (Fcoding_category_list, 0);
EXFUN (Fcoding_category_system, 1);
EXFUN (Fset_coding_priority_list, 1);
EXFUN (Fsubsidiary_coding_system, 2);
EXFUN (Fset_coding_priority_list, 1);
EXFUN (Fsubsidiary_coding_system, 2);
-extern Lisp_Object Qbig5, Qbuffer_file_coding_system, Qccl, Qcharset_g0;
+extern Lisp_Object Qucs4, Qutf8;
+extern Lisp_Object Qbig5, Qccl, Qcharset_g0;
extern Lisp_Object Qcharset_g1, Qcharset_g2, Qcharset_g3, Qcoding_system_error;
extern Lisp_Object Qcharset_g1, Qcharset_g2, Qcharset_g3, Qcoding_system_error;
-extern Lisp_Object Qcoding_system_p, Qcr, Qcrlf, Qctext, Qdecode, Qencode;
+extern Lisp_Object Qcoding_systemp, Qcr, Qcrlf, Qdecode, Qencode;
extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qescape_quoted;
extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output;
extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output;
extern Lisp_Object Qinput_charset_conversion, Qiso2022, Qlf, Qlock_shift;
extern Lisp_Object Qmnemonic, Qno_ascii_cntl, Qno_ascii_eol, Qno_conversion;
extern Lisp_Object Qeol_cr, Qeol_crlf, Qeol_lf, Qeol_type, Qescape_quoted;
extern Lisp_Object Qforce_g0_on_output, Qforce_g1_on_output;
extern Lisp_Object Qforce_g2_on_output, Qforce_g3_on_output;
extern Lisp_Object Qinput_charset_conversion, Qiso2022, Qlf, Qlock_shift;
extern Lisp_Object Qmnemonic, Qno_ascii_cntl, Qno_ascii_eol, Qno_conversion;
extern Lisp_Object Qno_iso6429, Qoutput_charset_conversion;
extern Lisp_Object Qpost_read_conversion, Qpre_write_conversion, Qseven;
extern Lisp_Object Qshift_jis, Qshort, Vcoding_system_for_read;
extern Lisp_Object Qno_iso6429, Qoutput_charset_conversion;
extern Lisp_Object Qpost_read_conversion, Qpre_write_conversion, Qseven;
extern Lisp_Object Qshift_jis, Qshort, Vcoding_system_for_read;
extern Lisp_Object Vfile_name_coding_system, Vkeyboard_coding_system;
extern Lisp_Object Vterminal_coding_system;
extern Lisp_Object Vfile_name_coding_system, Vkeyboard_coding_system;
extern Lisp_Object Vterminal_coding_system;
#define CODING_STATE_COMPOSITE (1 << 8) /* If set, we're currently processing
a composite character (i.e. a
character constructed by
overstriking two or more
characters). */
#define CODING_STATE_COMPOSITE (1 << 8) /* If set, we're currently processing
a composite character (i.e. a
character constructed by
overstriking two or more
characters). */
/* CODING_STATE_ISO2022_LOCK is the mask of flags that remain on until
explicitly turned off when in the ISO2022 encoder/decoder. Other flags are
turned off at the end of processing each character or escape sequence. */
/* CODING_STATE_ISO2022_LOCK is the mask of flags that remain on until
explicitly turned off when in the ISO2022 encoder/decoder. Other flags are
turned off at the end of processing each character or escape sequence. */
starts a directionality-control
sequence. The next character
must be 0, 1, 2, or ]. */
starts a directionality-control
sequence. The next character
must be 0, 1, 2, or ]. */
- ISO_ESC_5_11_0, /* We've seen 0x9B 0. The next
- character must be ]. */
- ISO_ESC_5_11_1, /* We've seen 0x9B 1. The next
- character must be ]. */
- ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next
- character must be ]. */
+ ISO_ESC_5_11_0, /* We've seen 0x9B 0. The next character must be ]. */
+ ISO_ESC_5_11_1, /* We've seen 0x9B 1. The next character must be ]. */
+ ISO_ESC_5_11_2, /* We've seen 0x9B 2. The next character must be ]. */
ISO_ESC_SINGLE_SHIFT, /* We've seen a complete single-shift sequence. */
ISO_ESC_LOCKING_SHIFT,/* We've seen a complete locking-shift sequence. */
ISO_ESC_DESIGNATE, /* We've seen a complete designation sequence. */
ISO_ESC_SINGLE_SHIFT, /* We've seen a complete single-shift sequence. */
ISO_ESC_LOCKING_SHIFT,/* We've seen a complete locking-shift sequence. */
ISO_ESC_DESIGNATE, /* We've seen a complete designation sequence. */
-#define CODING_STREAM_COMPOSE(str, flags, ch) \
-do { \
- (str)->flags = flags; \
- (str)->ch = ch; \
-} while (0)
+ For better or worse, currently Mule files are encoded in 7-bit ISO 2022.
+ For this reason, under Mule ISO_7 gets highest priority.
+ Putting NO_CONVERSION second prevents "binary corruption" in the
+ default case in all but the (presumably) extremely rare case of a
+ binary file which contains redundant escape sequences but no 8-bit
+ characters.
+
+ The remaining priorities are based on perceived "internationalization
+ political correctness." An exception is UCS-4 at the bottom, since
+ basically everything is compatible with UCS-4, but it is likely to
+ be very rare as an external encoding. */
- CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes,
- no locking shift, no single shift,
- using designation to switch charsets */
+ CODING_CATEGORY_NO_CONVERSION,
+ CODING_CATEGORY_UTF8,
CODING_CATEGORY_ISO_8_1, /* ISO2022 system using eight-bit bytes,
no locking shift, no designation sequences,
one-dimension characters in the upper half. */
CODING_CATEGORY_ISO_8_2, /* ISO2022 system using eight-bit bytes,
no locking shift, no designation sequences,
two-dimension characters in the upper half. */
CODING_CATEGORY_ISO_8_1, /* ISO2022 system using eight-bit bytes,
no locking shift, no designation sequences,
one-dimension characters in the upper half. */
CODING_CATEGORY_ISO_8_2, /* ISO2022 system using eight-bit bytes,
no locking shift, no designation sequences,
two-dimension characters in the upper half. */
+ CODING_CATEGORY_ISO_8_DESIGNATE, /* ISO2022 system using eight-bit bytes,
+ no locking shift, no single shift,
+ using designation to switch charsets */
(1 << CODING_CATEGORY_ISO_LOCK_SHIFT)
#define CODING_CATEGORY_BIG5_MASK \
(1 << CODING_CATEGORY_BIG5)
(1 << CODING_CATEGORY_ISO_LOCK_SHIFT)
#define CODING_CATEGORY_BIG5_MASK \
(1 << CODING_CATEGORY_BIG5)
+#define CODING_CATEGORY_UCS4_MASK \
+ (1 << CODING_CATEGORY_UCS4)
+#define CODING_CATEGORY_UTF16_MASK \
+ (1 << CODING_CATEGORY_UTF16)
+#define CODING_CATEGORY_UTF8_MASK \
+ (1 << CODING_CATEGORY_UTF8)
void set_encoding_stream_coding_system (Lstream *stream,
Lisp_Object codesys);
void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out,
void set_encoding_stream_coding_system (Lstream *stream,
Lisp_Object codesys);
void determine_real_coding_system (Lstream *stream, Lisp_Object *codesys_in_out,
#define LEADING_BYTE_CONTROL_1 0x8F /* represent normal 80-9F */
#define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */
#define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20)
#define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0)
#define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c)
#endif /* not MULE */
#define LEADING_BYTE_CONTROL_1 0x8F /* represent normal 80-9F */
#define LEADING_BYTE_LATIN_ISO8859_1 0x81 /* Right half of ISO 8859-1 */
#define BYTE_C1_P(c) ((unsigned int) ((unsigned int) (c) - 0x80) < 0x20)
#define BUFBYTE_FIRST_BYTE_P(c) ((c) < 0xA0)
#define BUFBYTE_LEADING_BYTE_P(c) BYTE_C1_P (c)
#endif /* not MULE */