- {
- *c1 = latin_a_char_to_byte1[c - 0x100];
- *c2 = latin_a_char_to_byte2[c - 0x100];
- }
- }
- else if (c < MIN_CHAR_GREEK)
- {
- Lisp_Object charsets = Vdefault_coded_charset_priority_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 */
- *charset = Vcharset_ucs_bmp;
- *c1 = c >> 8;
- *c2 = c & 0xff;
- }
- else if (c <= MAX_CHAR_GREEK)
- {
- *charset = Vcharset_greek_iso8859_7;
- *c1 = c - MIN_CHAR_GREEK + 0x20;
- *c2 = 0;
- }
- else if (c < MIN_CHAR_CYRILLIC)
- {
- *charset = Vcharset_ucs_bmp;
- *c1 = c >> 8;
- *c2 = c & 0xff;
- }
- else if (c <= MAX_CHAR_CYRILLIC)
- {
- *charset = Vcharset_cyrillic_iso8859_5;
- *c1 = c - MIN_CHAR_CYRILLIC + 0x20;
- *c2 = 0;
- }
- else if (c < MIN_CHAR_HEBREW)
- {
- *charset = Vcharset_ucs_bmp;
- *c1 = c >> 8;
- *c2 = c & 0xff;
- }
- else if (c <= MAX_CHAR_HEBREW)
- {
- *charset = Vcharset_hebrew_iso8859_8;
- *c1 = c - MIN_CHAR_HEBREW + 0x20;
- *c2 = 0;
- }
- else if (c < MIN_CHAR_THAI)
- {
- *charset = Vcharset_ucs_bmp;
- *c1 = c >> 8;
- *c2 = c & 0xff;
- }
- else if (c <= MAX_CHAR_THAI)
- {
- *charset = Vcharset_thai_tis620;
- *c1 = c - MIN_CHAR_THAI + 0x20;
- *c2 = 0;
- }
- else if (c < MIN_CHAR_HALFWIDTH_KATAKANA)
- {
- Lisp_Object charsets = Vdefault_coded_charset_priority_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 */
- *charset = Vcharset_ucs_bmp;
- *c1 = c >> 8;
- *c2 = c & 0xff;
- }
- else if (c <= MAX_CHAR_HALFWIDTH_KATAKANA)
- {
- *charset = Vcharset_katakana_jisx0201;
- *c1 = c - MIN_CHAR_HALFWIDTH_KATAKANA + 0x20;
- *c2 = 0;
- }
- else if (c <= MAX_CHAR_94)
- {
- *charset
- = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_94,
- ((c - MIN_CHAR_94) / 94) + '0',
- CHARSET_LEFT_TO_RIGHT);
- *c1 = ((c - MIN_CHAR_94) % 94) + 33;
- *c2 = 0;
- }
- else if (c <= MAX_CHAR_96)
- {
- *charset
- = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_96,
- ((c - MIN_CHAR_96) / 96) + '0',
- CHARSET_LEFT_TO_RIGHT);
- *c1 = ((c - MIN_CHAR_96) % 96) + 32;
- *c2 = 0;
- }
- else if (c <= MAX_CHAR_94x94)
- {
- *charset
- = CHARSET_BY_ATTRIBUTES (CHARSET_TYPE_94X94,
- ((c - MIN_CHAR_94x94) / (94 * 94)) + '0',
- CHARSET_LEFT_TO_RIGHT);
- *c1 = (((c - MIN_CHAR_94x94) / 94) % 94) + 33;
- *c2 = ((c - MIN_CHAR_94x94) % 94) + 33;
- }
- else if (c <= MAX_CHAR_96x96)
- {