From: tomo Date: Mon, 13 Sep 1999 05:37:34 +0000 (+0000) Subject: (breakup_char_1): Use `Vdefault_preferred_coded_charset_list' for X-Git-Tag: r21-2-19-utf-2000-0_7-0~22 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f4eefc19d374808509e1a7c9b6711c2fbe998a7b;p=chise%2Fxemacs-chise.git- (breakup_char_1): Use `Vdefault_preferred_coded_charset_list' for C0-Controls, Basic-Latin, C1-Controls and Latin-1-Supplement area. --- diff --git a/src/char-ucs.h b/src/char-ucs.h index 93fe8c6..a6a2280 100644 --- a/src/char-ucs.h +++ b/src/char-ucs.h @@ -424,23 +424,45 @@ INLINE void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2); INLINE void breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2) { - if (c <= MAX_CHAR_BASIC_LATIN) + if (c < 0x100) { - *charset = Vcharset_ascii; - *c1 = charset_get_byte1 (*charset, c); - *c2 = charset_get_byte2 (*charset, c); - } - else if (c < 0xA0) - { - *charset = Vcharset_control_1; - *c1 = charset_get_byte1 (*charset, c); - *c2 = charset_get_byte2 (*charset, c); - } - else if (c <= 0xff) - { - *charset = Vcharset_latin_iso8859_1; - *c1 = charset_get_byte1 (*charset, c); - *c2 = charset_get_byte2 (*charset, c); + Lisp_Object charsets = Vdefault_preferred_coded_charset_list; + while (!EQ (charsets, Qnil)) + { + *charset = Ffind_charset (Fcar (charsets)); + if (!EQ (*charset, Qnil) + && (*c1 = charset_get_byte1 (*charset, c)) ) + { + *c2 = charset_get_byte2 (*charset, c); + return; + } + charsets = Fcdr (charsets); + } + /* otherwise */ + if (c <= MAX_CHAR_BASIC_LATIN) + { + *charset = Vcharset_ascii; + *c1 = charset_get_byte1 (*charset, c); + *c2 = charset_get_byte2 (*charset, c); + } + else if (c < 0xA0) + { + *charset = Vcharset_control_1; + *c1 = charset_get_byte1 (*charset, c); + *c2 = charset_get_byte2 (*charset, c); + } + else if (c <= 0xff) + { + *charset = Vcharset_latin_iso8859_1; + *c1 = charset_get_byte1 (*charset, c); + *c2 = charset_get_byte2 (*charset, c); + } + else + { + *charset = Vcharset_ucs_bmp; + *c1 = c >> 8; + *c2 = c & 0xff; + } } else if (c <= 0x17f) {