Function: find-charset-string

find-charset-string is a function defined in charset.c.

Signature

(find-charset-string STR &optional TABLE)

Documentation

Return a list of charsets in STR.

Optional arg TABLE if non-nil is a translation table to look up.

If STR is unibyte, the returned list may contain only ascii, eight-bit-control, and eight-bit-graphic.

View in manual

Probably introduced at or before Emacs version 20.1.

Source Code

// Defined in /usr/src/emacs/src/charset.c
{
  CHECK_STRING (str);

  Lisp_Object charsets = make_nil_vector (charset_table_used);
  find_charsets_in_text (SDATA (str), SCHARS (str), SBYTES (str),
			 charsets, table,
			 STRING_MULTIBYTE (str));
  Lisp_Object val = Qnil;
  for (int i = charset_table_used - 1; i >= 0; i--)
    if (!NILP (AREF (charsets, i)))
      val = Fcons (CHARSET_NAME (charset_table + i), val);
  return val;
}