DervishD wrote:
    Hi Tony :)

 * A.J.Mechelynck <[EMAIL PROTECTED]> dixit:
DervishD wrote:
* A.J.Mechelynck <[EMAIL PROTECTED]> dixit:
[...]
As long as your vimrc includes only 7-bit ASCII, there's no problem. But in the particular case of your vimrc, you could add the following lines at top, do ":setlocal fenc=latin1", and (IIUC) it will always be _read_ as Latin1 in the future, because of the accented letters in your name:
   Won't "scriptencoding" work? I have latin1 characters in my vimrc
and setting "encoding=utf8" now causes vim to spill an error when
reading it :((( I'm afraid I will have to keep it at the default value.
Maybe I didn't express myself clearly enough. Unless your vimrc includes codepoints higher than U+00FF, it can be represented in Latin1. Any Latin1 file which includes the words "Raúl Núñez" will cause the UTF-8 heuristic to fail in 'fileencodings', and Vim will see it as Latin1.

    Which doesn't work if 'encoding' is utf8, I've tested :(( Vim barfs
in some latin1 characters I use in 'showbreak' (I don't know the Unicode
code point of the characters, but in latin1 they're 0xf7 and 0xbb).

":scriptencoding" is used to tell Vim's sourcing engine in which 'fileencoding' the script was written. There are two cases where it is not necessary:
- the same as 'encoding', or
- UTF-8 with BOM.
IOW, yes, if you set 'encoding' to UTF-8 you may have to also issue ":scriptencoding latin1".

    I have this line as the first line of my "options.vim", but it
doesn't seem to work. Probably because I do the following: my /etc/vimrc
sources /etc/vim/options.vim, which is the problematic script and the
only one that has "scriptencoding" on it. Probably when vim is parsing
the file, it already has decided that the rc files are utf-8, since
/etc/vimrc has no latin1 characters on it.

":scriptencoding" applies no farther than the end of the current script.


    I'll make a test... OK, it still fails. I've put "scriptencoding" at
the top of my vimrc file, and vim barfs in the same latin1 characters.

0xF7 in Lain1, or Unicode U+00F7, is the divide sign (English style, a colon with a dash in the middle). 0xBB, or U+00BB, is the closing French quote (Ctrl-K >>).


    Again, thanks a lot for your help, you're great :))))

    Raúl Núñez de Arenas Coronado


OK, let's try the opposite: edit options.vim, remove the sriptencoding statement, then save it with

        :setlocal bomb fenc=utf-8
        :x

Then restart Vim and see if it works.


Best regards,
Tony.

Reply via email to