Gary Johnson wrote:
> When starting Vim on a Linux system, 'fileencodings' is set to
> "ucs-bom,utf-8,default,latin1". But, after executing
>
> set fileencodings&
>
> or
>
> set all&
>
> the value changes to "usc-bom" even though the value of 'encoding'
> has remained "utf-8". ":help fileencodings" says:
>
> 'fileencodings' 'fencs' string (default: "ucs-bom",
> "ucs-bom,utf-8,default,latin1" when
> 'encoding' is set to a Unicode value)
>
> I think the behavior of ":set fileencodings&" and ":set all&" is
> contrary to the documentation and is a bug.
>
> Example:
>
> $ vim -N -u NONE -i NONE
> :verbose set encoding? fileencodings?
> encoding=utf-8
> fileencodings=ucs-bom,utf-8,default,latin1
> :set all&
> :verbose set encoding? fileencodings?
> encoding=utf-8
> fileencodings=ucs-bom
The generic options code only handles a static default value. In this
case the default value depends on the 'encoding' option. That requires
some extra code to handle the exception. I think it's worth it.
--
This computer is so slow, it takes forever to execute and endless loop!
/// Bram Moolenaar -- Br...@Moolenaar.net --
http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features --
http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims --
http://ICCF-Holland.org ///