Next: , Previous: , Up: Coding Systems   [Contents][Index]


66.6.5 Encoding and Decoding Text

Function: decode-coding-region start end coding-system &optional buffer

This function decodes the text between start and end which is encoded in coding-system. This is useful if you’ve read in encoded text from a file without decoding it (e.g. you read in a JIS-formatted file but used the binary or no-conversion coding system, so that it shows up as ‘^[$B!<!+^[(B’). The length of the encoded text is returned. buffer defaults to the current buffer if unspecified.

Function: encode-coding-region start end coding-system &optional buffer

This function encodes the text between start and end using coding-system. This will, for example, convert Japanese characters into stuff such as ‘^[$B!<!+^[(B’ if you use the JIS encoding. The length of the encoded text is returned. buffer defaults to the current buffer if unspecified.