Function: set-process-coding-system

set-process-coding-system is a function defined in process.c.

Signature

(set-process-coding-system PROCESS &optional DECODING ENCODING)

Documentation

Set coding systems of PROCESS to DECODING and ENCODING.

DECODING will be used to decode subprocess output and ENCODING to encode subprocess input.

View in manual

Probably introduced at or before Emacs version 20.1.

Source Code

// Defined in /usr/src/emacs/src/process.c
{
  CHECK_PROCESS (process);

  struct Lisp_Process *p = XPROCESS (process);

  Fcheck_coding_system (decoding);
  Fcheck_coding_system (encoding);
  encoding = coding_inherit_eol_type (encoding, Qnil);
  pset_decode_coding_system (p, decoding);
  pset_encode_coding_system (p, encoding);

  /* If the sockets haven't been set up yet, the final setup part of
     this will be called asynchronously. */
  if (p->infd < 0 || p->outfd < 0)
    return Qnil;

  setup_process_coding_systems (process);

  return Qnil;
}