comparison src/charset.h @ 29539:a6f1d75744d8

(CHARSET_8_BIT_GRAPHIC): Define as 0x80. (UNIBYTE_STR_AS_MULTIBYTE_P): Fix for an invalid multibyte sequence.
author Kenichi Handa <handa@m17n.org>
date Sat, 10 Jun 2000 00:13:13 +0000
parents 383e4e21306a
children 825505ff211e
comparison
equal deleted inserted replaced
29538:c0c34d18e8a0 29539:a6f1d75744d8
64 charset dimension base leading-code extended leading-code 64 charset dimension base leading-code extended leading-code
65 --------------------------------------------------------------------------- 65 ---------------------------------------------------------------------------
66 0x00 official dim1 -- none -- -- none -- 66 0x00 official dim1 -- none -- -- none --
67 (ASCII) 67 (ASCII)
68 0x01..0x7F --never used-- 68 0x01..0x7F --never used--
69 0x80 --never used-- 69 0x80 official dim1 -- none -- -- none --
70 (eight-bit-graphic)
70 0x81..0x8F official dim1 same as charset -- none -- 71 0x81..0x8F official dim1 same as charset -- none --
71 0x90..0x99 official dim2 same as charset -- none -- 72 0x90..0x99 official dim2 same as charset -- none --
72 0x9A..0x9D --never used-- 73 0x9A..0x9D --never used--
73 0x9E official dim1 same as charset -- none -- 74 0x9E official dim1 same as charset -- none --
74 (eight-bit-control) 75 (eight-bit-control)
75 0x9F official dim1 -- none -- -- none -- 76 0x9F --never used--
76 (eight-bit-graphic)
77 0xA0..0xDF private dim1 0x9A same as charset 77 0xA0..0xDF private dim1 0x9A same as charset
78 of 1-column width 78 of 1-column width
79 0xE0..0xEF private dim1 0x9B same as charset 79 0xE0..0xEF private dim1 0x9B same as charset
80 of 2-column width 80 of 2-column width
81 0xF0..0xF4 private dim2 0x9C same as charset 81 0xF0..0xF4 private dim2 0x9C same as charset
117 #define MAX_CHARSET 0xFE 117 #define MAX_CHARSET 0xFE
118 118
119 /* Definition of special charsets. */ 119 /* Definition of special charsets. */
120 #define CHARSET_ASCII 0 /* 0x00..0x7F */ 120 #define CHARSET_ASCII 0 /* 0x00..0x7F */
121 #define CHARSET_8_BIT_CONTROL 0x9E /* 0x80..0x9F */ 121 #define CHARSET_8_BIT_CONTROL 0x9E /* 0x80..0x9F */
122 #define CHARSET_8_BIT_GRAPHIC 0x9F /* 0xA0..0xFF */ 122 #define CHARSET_8_BIT_GRAPHIC 0x80 /* 0xA0..0xFF */
123 123
124 extern int charset_latin_iso8859_1; /* ISO8859-1 (Latin-1) */ 124 extern int charset_latin_iso8859_1; /* ISO8859-1 (Latin-1) */
125 extern int charset_jisx0208_1978; /* JISX0208.1978 (Japanese Kanji old set) */ 125 extern int charset_jisx0208_1978; /* JISX0208.1978 (Japanese Kanji old set) */
126 extern int charset_jisx0208; /* JISX0208.1983 (Japanese Kanji) */ 126 extern int charset_jisx0208; /* JISX0208.1983 (Japanese Kanji) */
127 extern int charset_katakana_jisx0201; /* JISX0201.Kana (Japanese Katakana) */ 127 extern int charset_katakana_jisx0201; /* JISX0201.Kana (Japanese Katakana) */
441 /* Return 1 iff the byte sequence at unibyte string STR (LENGTH bytes) 441 /* Return 1 iff the byte sequence at unibyte string STR (LENGTH bytes)
442 is valid as a multibyte form. If valid, by a side effect, BYTES is 442 is valid as a multibyte form. If valid, by a side effect, BYTES is
443 set to the byte length of the multibyte form. */ 443 set to the byte length of the multibyte form. */
444 444
445 #define UNIBYTE_STR_AS_MULTIBYTE_P(str, length, bytes) \ 445 #define UNIBYTE_STR_AS_MULTIBYTE_P(str, length, bytes) \
446 (((bytes) = BYTES_BY_CHAR_HEAD ((str)[0])) == 1 \ 446 (((str)[0] < 0x80 || (str)[0] >= 0xA0) \
447 || ((str)[0] != LEADING_CODE_8_BIT_CONTROL \ 447 ? (bytes) = 1 \
448 : (((bytes) = BYTES_BY_CHAR_HEAD ((str)[0])), \
449 ((str)[0] != LEADING_CODE_8_BIT_CONTROL \
448 && (bytes) <= (length) \ 450 && (bytes) <= (length) \
449 && !CHAR_HEAD_P ((str)[1]) \ 451 && !CHAR_HEAD_P ((str)[1]) \
450 && ((bytes) == 2 \ 452 && ((bytes) == 2 \
451 || (!CHAR_HEAD_P ((str)[2]) \ 453 || (!CHAR_HEAD_P ((str)[2]) \
452 && ((bytes) == 3 \ 454 && ((bytes) == 3 \
453 || !CHAR_HEAD_P ((str)[3])))))) 455 || !CHAR_HEAD_P ((str)[3])))))))
454 456
455 /* Return 1 iff the byte sequence at multibyte string STR is valid as 457 /* Return 1 iff the byte sequence at multibyte string STR is valid as
456 a unibyte form. By a side effect, BYTES is set to the byte length 458 a unibyte form. By a side effect, BYTES is set to the byte length
457 of one character at STR. */ 459 of one character at STR. */
458 460