Function: split-char

split-char is a function defined in charset.c.

Signature

(split-char CH)

Documentation

Return list of charset and one to four position-codes of CH.

The charset is decided by the current priority order of charsets. A position-code is a byte value of each dimension of the code-point of CH in the charset.

Probably introduced at or before Emacs version 20.1.

Source Code

// Defined in /usr/src/emacs/src/charset.c
{
  struct charset *charset;
  int c, dimension;
  unsigned code;
  Lisp_Object val;

  CHECK_CHARACTER (ch);
  c = XFIXNAT (ch);
  charset = CHAR_CHARSET (c);
  if (! charset)
    emacs_abort ();
  code = ENCODE_CHAR (charset, c);
  if (code == CHARSET_INVALID_CODE (charset))
    emacs_abort ();
  dimension = CHARSET_DIMENSION (charset);
  for (val = Qnil; dimension > 0; dimension--)
    {
      val = Fcons (make_fixnum (code & 0xFF), val);
      code >>= 8;
    }
  return Fcons (CHARSET_NAME (charset), val);
}