Thursday, December 10, 2020

Re: Changing encoding of an already loaded buffer

On 10/12/2020 5.58, Tony Mechelynck wrote:
> The problem with ":setg fenc=utf8 bomb" is that *every* new text file
> will start with 0xEF 0xBB 0xBF unless you explicitly turn it off for
> that file by means of ":setl nobomb" or ":setl fenc=latin1" or similar
> before writing it.

That's the point, indeed



> For C sources this wil confuse the compiler
> (generating an error and preventing successful compilation) and for
> anything starting with a shebang (shell scripts, perl sources, etc.)
> it will prevent the #! shebang leader from being recognized. OTOH for

It's true, it depends on what you most do in the editor, if you need to
frequently create files that cannot have a BOM in them, it's most likely
inconvenient. Maybe use more than one editor, or aliases with different
configurations...?

I indeed personally use text editors mostly for normal textual or web
files, use mostly IDEs for programming, rarely edit shell scripts, and
it actually may well be that I usually left bomb disabled when using
unices...

Anyway, for textual files or filetypes that do support the BOM, I
believe it's more beneficial to include it, and that it should not be
discouraged.

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/dcc46e3c-f5d5-3c80-e6d7-10a8e13be7aa%40tiscali.it.

No comments:

Post a Comment