How to find and remove the invisible characters in text file using emacs

前端 未结 3 2013
后悔当初
后悔当初 2020-12-30 07:10

I have a txt file named COPYING which is edited on windows. It contains windows style eol

$ file COPYING 
COPYING: ASCII English text, with CRLF line ter         


        
3条回答
  •  不知归路
    2020-12-30 07:58

    Check out M-x set-buffer-file-coding-system. From the documentation:

    (set-buffer-file-coding-system CODING-SYSTEM &optional FORCE NOMODIFY)

    Set the file coding-system of the current buffer to CODING-SYSTEM. This means that when you save the buffer, it will be converted according to CODING-SYSTEM. For a list of possible values of CODING-SYSTEM, use M-x list-coding-systems.

    So, going from DOS to UNIX, M-x set-buffer-file-coding-system unix.

提交回复
热议问题