Function: encode-big5-char

encode-big5-char is a function defined in coding.c.

Signature

(encode-big5-char CH)

Documentation

Encode the Big5 character CH to BIG5 coding system.

Return the corresponding character code in Big5.

Source Code

// Defined in /usr/src/emacs/src/coding.c
{
  Lisp_Object spec, attrs, charset_list;
  struct charset *charset;
  int c;
  unsigned code;

  CHECK_CHARACTER (ch);
  c = XFIXNAT (ch);
  CHECK_CODING_SYSTEM_GET_SPEC (Vbig5_coding_system, spec);
  attrs = AREF (spec, 0);
  if (ASCII_CHAR_P (c)
      && ! NILP (CODING_ATTR_ASCII_COMPAT (attrs)))
    return ch;

  charset_list = CODING_ATTR_CHARSET_LIST (attrs);
  charset = char_charset (c, charset_list, &code);
  if (code == CHARSET_INVALID_CODE (charset))
    error ("Can't encode by Big5 encoding: %c", c);

  return make_fixnum (code);
}