Tuesday, August 9, 2011

How to display and remove BOM in utf-8 encoded file

Hi,
I developed a website with Vim, working both on linux and windows and
never had any problems. The other day someone else needed to edit some
files and tried to use Mac and Windows. Apparently in the files he
edited there is this Byte-Order Mark. I discovered this only via the
w3c validator that gave me this warning:

"Byte-Order Mark found in UTF-8 File. The Unicode Byte-Order Mark
(BOM) in UTF-8 encoded files is known to cause problems for some text
editors and older browsers. You may want to consider avoiding its use
until it is better supported."

The only way I could solve the problem was using notepad++ which has
an option to explicitly save the file without the BOM. Is there a way
to do the same thing in Vim? Maybe even to display this BOM?

Thanks,
Carlo

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: