return lb;
}
+#ifdef UTF2000
+unsigned char
+charset_get_byte1 (Lisp_Object charset, Emchar ch)
+{
+ Emchar_to_byte_table* table;
+
+ if ((table = XCHARSET_TO_BYTE1_TABLE (charset)) != NULL)
+ return get_byte_from_character_table (ch, table);
+ else if (EQ (charset, Vcharset_ascii))
+ return ch <= 0x7f ? ch : 0;
+ else if (EQ (charset, Vcharset_control_1))
+ return (0x80 <= ch) && (ch < 0xA0) ? ch & 0x7f : 0;
+ else if (EQ (charset, Vcharset_latin_iso8859_1))
+ return (0xA0 <= ch) && (ch <= 0xff) ? ch & 0x7f : 0;
+ else if (EQ (charset, Vcharset_cyrillic_iso8859_5))
+ return (MIN_CHAR_GREEK <= ch) && (ch <= MAX_CHAR_CYRILLIC) ?
+ ch - MIN_CHAR_CYRILLIC + 0x20 : 0;
+ else if (EQ (charset, Vcharset_greek_iso8859_7))
+ return (MIN_CHAR_GREEK <= ch) && (ch <= MAX_CHAR_GREEK) ?
+ ch - MIN_CHAR_GREEK + 0x20 : 0;
+ else if (EQ (charset, Vcharset_hebrew_iso8859_8))
+ return (MIN_CHAR_HEBREW <= ch) && (ch <= MAX_CHAR_HEBREW) ?
+ ch - MIN_CHAR_HEBREW + 0x20 : 0;
+ else if (EQ (charset, Vcharset_thai_tis620))
+ return (MIN_CHAR_THAI <= ch) && (ch <= MAX_CHAR_THAI) ?
+ ch - MIN_CHAR_THAI + 0x20 : 0;
+ else if (EQ (charset, Vcharset_katakana_jisx0201))
+ return (MIN_CHAR_HALFWIDTH_KATAKANA <= ch)
+ && (ch <= MAX_CHAR_HALFWIDTH_KATAKANA) ?
+ ch - MIN_CHAR_HALFWIDTH_KATAKANA + 0x20 : 0;
+ else if (EQ (charset, Vcharset_ucs_bmp))
+ return ch & 0xff;
+ else if (XCHARSET_DIMENSION (charset) == 1)
+ {
+ if (XCHARSET_CHARS (charset) == 94)
+ return (MIN_CHAR_94 + (XCHARSET_FINAL (charset) - '0') * 94 <= ch)
+ && (ch < MIN_CHAR_94 + (XCHARSET_FINAL (charset) - '0' + 1) * 94) ?
+ ((ch - MIN_CHAR_94) % 94) + 33 : 0;
+ else /* if (XCHARSET_CHARS (charset) == 96) */
+ return (MIN_CHAR_96 + (XCHARSET_FINAL (charset) - '0') * 96 <= ch)
+ && (ch < MIN_CHAR_96 + (XCHARSET_FINAL (charset) - '0' + 1) * 96) ?
+ ((ch - MIN_CHAR_94) % 96) + 32 : 0;
+ }
+ else /* if (XCHARSET_DIMENSION (charset) == 2) */
+ {
+ if (XCHARSET_CHARS (charset) == 94)
+ return (MIN_CHAR_94x94
+ + (XCHARSET_FINAL (charset) - '0') * 94 * 94 <= ch)
+ && (ch < MIN_CHAR_94x94
+ + (XCHARSET_FINAL (charset) - '0' + 1) * 94 * 94) ?
+ (((ch - MIN_CHAR_94x94) / 94) % 94) + 33 : 0;
+ else /* if (XCHARSET_CHARS (charset) == 96) */
+ return (MIN_CHAR_96x96
+ + (XCHARSET_FINAL (charset) - '0') * 96 * 96 <= ch)
+ && (ch < MIN_CHAR_96x96
+ + (XCHARSET_FINAL (charset) - '0' + 1) * 96 * 96) ?
+ (((ch - MIN_CHAR_96x96) / 96) % 96) + 32 : 0;
+ }
+}
+
+unsigned char
+charset_get_byte2 (Lisp_Object charset, Emchar ch)
+{
+ if (XCHARSET_DIMENSION (charset) == 1)
+ return 0;
+ else
+ {
+ Emchar_to_byte_table* table;
+
+ if ((table = XCHARSET_TO_BYTE2_TABLE (charset)) != NULL)
+ return get_byte_from_character_table (ch, table);
+ else if (EQ (charset, Vcharset_ucs_bmp))
+ return (ch >> 8) & 0xff;
+ else if (XCHARSET_CHARS (charset) == 94)
+ return (MIN_CHAR_94x94
+ + (XCHARSET_FINAL (charset) - '0') * 94 * 94 <= ch)
+ && (ch < MIN_CHAR_94x94
+ + (XCHARSET_FINAL (charset) - '0' + 1) * 94 * 94) ?
+ ((ch - MIN_CHAR_94x94) % 94) + 33 : 0;
+ else /* if (XCHARSET_CHARS (charset) == 96) */
+ return (MIN_CHAR_96x96
+ + (XCHARSET_FINAL (charset) - '0') * 96 * 96 <= ch)
+ && (ch < MIN_CHAR_96x96
+ + (XCHARSET_FINAL (charset) - '0' + 1) * 96 * 96) ?
+ ((ch - MIN_CHAR_96x96) % 96) + 32 : 0;
+ }
+}
+
+Lisp_Object Vdefault_preferred_coded_charset_list;
+#endif
+
\f
/************************************************************************/
/* Basic charset Lisp functions */
DEFVAR_LISP ("utf-2000-version", &Vutf_2000_version /*
Version number of UTF-2000.
*/ );
+
+ Vdefault_preferred_coded_charset_list = Qnil;
+ DEFVAR_LISP ("default-preferred-coded-charset-list",
+ &Vdefault_preferred_coded_charset_list /*
+Default order of preferred coded-character-set.
+*/ );
#endif
}