In GNU Emacs 23.1, there is a problem in decode_eol of coding.c. In buffer of which enable-multibyte-characters is nil, the function `decode-coding-region' should delete the character '^M' (code: 0x0d) at the end of line, in case that the function parameter `coding-system' is *-dos (and the variable `inhibit-eol-conversion' is nil). But, in practice, the function doesn't delete all of the character '^M'. You can watch the problem with the following. ======================================================================== (progn (pop-to-buffer (generate-new-buffer-name "*scratch*")) (set-buffer-multibyte nil) (insert (encode-coding-string "あ" 'euc-jp) "\xd" "\n") (read-char "(press any key)") (decode-coding-region (point-min) (point-max) 'euc-jp-dos) (read-char "doesn't delete all of the character '^M'. (press any key)") (set-buffer-multibyte t)) ======================================================================== I made a patch to fix the problem. Please check it.