Reputation: 963
I open an XML file in Vim and found that there are a lot of ^M
and ^G
symbols showen in it.So I try to use dos2unix
to drop the ^M
symbols,but it told me that the file is binary file, which makes it skipping the file.After drop the ^G
symbols manunally, dos2unix
is successfully process that file. My question is: what does ^G
actually mean here ? Is it ^G
in a file makes it a binary file?
Upvotes: 2
Views: 126
Reputation:
To add to the above answer, Ctrl-M is also usually an end-of-line / linebreak character corresponding to the "\r\n" carriage return used by Windows.
You can read more about in the answers to this question, which include some methods of converting them to unix-style line endings (if you need to): What does ^M character mean in Vim?
Upvotes: 1
Reputation: 198304
^G
is the bell character. When the file is displayed on a traditional terminal, you will hear a beep when you reach that character. There is no difference between "binary" and "text" files, really, so dos2unix
is just guessing, and in this case guessing wrong. You can use the option -f
to force it to convert files it thinks are binary.
Upvotes: 4