Function: decode-coding-region
decode-coding-region is an interactive function defined in coding.c.
Signature
(decode-coding-region START END CODING-SYSTEM &optional DESTINATION)
Documentation
Decode the current region using the specified coding system.
Interactively, prompt for the coding system to decode the region, and replace the region with the decoded text.
"Decoding" means transforming bytes into readable text (characters).
If, for instance, you have a region that contains data that represents
the two bytes #xc2 #xa9, after calling this function with the utf-8
coding system, the region will contain the single
character ?\N{COPYRIGHT SIGN}.
When called from a program, takes four arguments:
START, END, CODING-SYSTEM, and DESTINATION.
START and END are buffer positions.
Optional 4th arguments DESTINATION specifies where the decoded text goes. If nil, the region between START and END is replaced by the decoded text. If buffer, the decoded text is inserted in that buffer after point (point does not move). If that buffer is unibyte, it receives the individual bytes of the internal representation of the decoded text. In those cases, the length of the decoded text is returned. If DESTINATION is t, the decoded text is returned.
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.)
Probably introduced at or before Emacs version 20.3.
Key Bindings
Source Code
// Defined in /usr/src/emacs/src/coding.c
{
return code_convert_region (start, end, coding_system, destination, 0, 0);
}