Function: encode-coding-string

encode-coding-string is a function defined in coding.c.

Signature

(encode-coding-string STRING CODING-SYSTEM &optional NOCOPY BUFFER)

Documentation

Encode STRING to CODING-SYSTEM, and return the result.

Optional third arg NOCOPY non-nil means it is OK to return STRING itself if the encoding operation is trivial.

Optional fourth arg BUFFER non-nil means that the encoded text is inserted in that buffer after point (point does not move). In this case, the return value is the length of the encoded text.

This function sets last-coding-system-used to the precise coding system used (which may be different from CODING-SYSTEM if CODING-SYSTEM is
not fully specified.) The function does not change the match data.

View in manual

Probably introduced at or before Emacs version 20.3.

Source Code

// Defined in /usr/src/emacs/src/coding.c
{
  return code_convert_string (string, coding_system, buffer,
			      1, ! NILP (nocopy), 0);
}