Wednesday, December 9, 2020

Re: Changing encoding of an already loaded buffer

On 08/12/2020 10.47, A. Wik wrote:
> Hi all,
>
> I tried a few things:
>
> (1) gvim -f ++enc=utf8 -
> result: "E492: Not an editor command: +enc=utf8
> (2) gvim -f +enc=utf8 -
> result: see (1)
> (3) gvim -f +"set fenc=utf8" -
> result: no error message; sets fenc to "utf-8", but file is loaded as
> if with latin1.
> (4) gvim -f -c "set fenc=utf8" -
> result: see (3)
> (5) gvim -f --cmd "set fenc=utf8" -
> no error message; fenc remains is "latin1"

Yes, I tried stuff like that while perusing the manual a hundred times,
it can't work and that's also kind of declared in some points of the
documentation; :h fenc is a jungle, and I seem to remember that it's
also not completely correct. Basically 'fenc' is only looked at when
writing a file, and who knows what the output of that write will be.

So essentially, besides 'fencs', the ++enc "opt" (which **has nothing to
do with the 'enc' option!!!**) is the only thing that can have an effect
when reading a file, and after it's read you better forget about fixing
its encoding.

The only way forward in my opinion would be to deprecate 'enc', 'fenc',
++enc and probably 'fencs', giving warnings when they do get used, and
introduce completely different options and commands.

--
--
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/10740b06-b5c1-cc44-9c3e-d5607662214a%40tiscali.it.

No comments:

Post a Comment