Search the web
Sign In
New User? Sign Up
vim-multibyte · Vim (Vi IMproved) text editor special language list
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
BOM in QuickFix window   Message List  
Reply | Forward Message #2628 of 2636 |
Re: BOM in QuickFix window


On 08/07/09 22:48, Aleksey wrote:
>
> Hi.
>
> I'm using few MONO apps (Nemerle compiler and COCO/R parser generator)
> through compiler plugins in VIM under Linux, and the problem is that
> they produce output starting with FEFF.
> I had this problem about a half a year ago and being (and staying) a
> newbie, thought that the problem was with *errorformat* but didn't
> cope defining it correctly - not sure if it is possible.
> I found workaround, setting LANG=en_US in compiler call command.
>
> I have encoding and termencoding set to 'utf-8' and locale is
> 'en_US.utf8'.
>
> Is there a better way to solve this problem?
>
> Thanks

Make sure your 'fileencodings' option (plural) starts with "ucs-bom". In
that case, for editfiles at least (not sure about quickfix error files),
Vim will recognise the Unicode codepoint U+FEFF (known as the BOM for
Byte Order Mark though actually it's more than that) when it happens at
the very start of a file, and set 'fileencoding' (singular) and 'bomb'
accordingly for that file, as follows:

Lead bytes (hex) 'fileencoding' 'bomb'
EF BB BF utf-8 bomb
00 00 FE FF ucs-4 bomb
FF FE 00 00 ucs-4le bomb
FE FF utf-16 bomb
FF FE utf-16le bomb
anything else not yet known nobomb

As you can see, the BOM allows us to identify all Unicode encodings
(endianness included, but treating UCS-2 as a particular case of UTF-16,
which it is) assuming that no little-endian UTF-16 file will ever start
with a NULL codepoint, which I think is a reasonable assumption. ("Not
yet known" in the table above means "try the next entry in
'fileencodings'".)

If, after trying it, you find that it doesn't work for the quickfix
errorfile, come back to report it, and in that case maybe Bram will pass
by and add it to his TODO list. But even if he does, don't set your
hopes too high: it's a very long list, see |todo.txt| in the Vim help
(the file is currently 4705 lines long as of 2 July 2009, but I didn't
count how many todo items (which should be fewer ;-) ) are in it.

IIUC, even if 'fileencodings' doesn't work for quickfix error files,
setting LC_MESSAGES should be enough (LANG is used as a default for any
LC_<something> which is unset, or LC_ALL if present overrides any other
LC_* even if present). Maybe even just using ":language messages en-US"
or ":lang mess C" near the top of your vimrc could be enough.



Best regards,
Tony.
--
hundred-and-one symptoms of being an internet addict:
66. You create a homepage with the impression to cure the afflicted...but
your hidden agenda is to receive more e-mail.

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




Thu Jul 9, 2009 3:52 am

antoine.mechelynck@...
Send Email Send Email

Forward
Message #2628 of 2636 |
Expand Messages Author Sort by Date

Hi. I'm using few MONO apps (Nemerle compiler and COCO/R parser generator) through compiler plugins in VIM under Linux, and the problem is that they produce...
Aleksey
alex.baibarin@...
Send Email
Jul 9, 2009
1:54 am

... Make sure your 'fileencodings' option (plural) starts with "ucs-bom". In that case, for editfiles at least (not sure about quickfix error files), Vim will...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 9, 2009
3:53 am

... Thanks for your answer. fileencoding already had 'ucs-bom' in its start, so it didnt' help. I also have :language messages C, so it didn't help either. I...
Aleksey
alex.baibarin@...
Send Email
Jul 9, 2009
6:52 am

... should be 'fileencodings' with s at the end. There are two different options, with and without s, and they don't have the same meaning. Without s, it's the...
Tony Mechelynck
antoine.mechelynck@...
Send Email
Jul 9, 2009
9:52 am

On Jul 9, 1:51 pm, Tony Mechelynck <antoine.mechely...@...> ... Sorry, mistyped it. It's 'fileencodings' certainly, and 'ucs-bom' is the list. ... I...
Aleksey
alex.baibarin@...
Send Email
Jul 9, 2009
10:11 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help