On 20/10/09 07:08, bill lam wrote:
>
> On Tue, 20 Oct 2009, Tony Mechelynck wrote:
>> What makes you think so? On the contrary, I believe that use of a BOM
>> with any Unicode text (including UTF-8) will become more frequent as
>> conformant applications become the rule rather than the exception.
>>
>
> I respect your choice of using utf8 with bom in linux, it is your
> individual preference and freedom.  However the suggestion of putting
> that into vimrc for other linux users is another matter, at least not
> before your anticipation actually materialized.
>

One possible setting which I recommend is

        :setglobal fenc=latin1 bomb

With that setting, newly created files will have 'fileencoding' set to 
Latin1, and they will of course not have a BOM irrespective of the 
'bomb' setting (see ":help 'bomb'). This is perfectly OK for most C 
sources and shell scripts, which have a different mechanism, "\u1234", 
to embed UTF-8 codepoints into ASCII text. With that setting, it is only 
after the user positively sets a file's 'fileencoding' to some Unicode 
encoding that 'bomb' will matter. If he wants a UTF-8 file with no BOM, 
nothing prevents using

        :setlocal fenc=utf-8 nobomb


For *.txt files, which have no instrinsic way to mention the encoding, 
use of a BOM as a sentinel for Unicode (including UTF-8) is actually 
useful (and recommended by the Unicode Consortium's FAQ). For HTML, the 
user has the choice to either leave them in ASCII or Latin1 (or even in 
some other legacy "charset" mentioned in the Content-Type header or 
<meta> tag), with entities such as &oelig; &#339; or &#x0153; for the 
occasional out-of-band codepoint (in this case, three ways to represent 
the French "oe ligature" œ); or he can go full-Unicode and in that case, 
in my experience the presence of a BOM does no harm. (If the BOM at 
http://users.skynet.be/antoine.mechelynck/index.htm gives you problems, 
I'd like you to tell me by private mail exactly what problems in which 
version of which browser; please paste your user-agent string if you can.)

All this is irrelevant for existing files, since with a "proper" setting 
of 'fileencodings' (plural), such as "ucs-bom,utf-8,default,latin1" (the 
Vim7 default for Unicode) the local 'bomb' option will be set or cleared 
when opening the file according to what it already has.


Best regards,
Tony.
-- 
"The eleventh commandment was `Thou Shalt Compute' or `Thou Shalt Not
Compute' -- I forget which."
                -- Epigrams in Programming, ACM SIGPLAN Sept. 1982

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to