Hi Tony :)

 * A.J.Mechelynck <[EMAIL PROTECTED]> dixit:
> >>":scriptencoding" applies no farther than the end of the current script.
> >
> >    And does it affect sourced scripts or should I put that line in all
> >scripts?
> 
> It doesn't affect sourced scripts. Each script should include or not 
> include a ":scriptencoding" statement according to what bytes are found in 
> that script itself.

    OK, I thought it was more like a flag, meaning "from now on,
everything you source is latin1". Of course, it wouldn't make much sense
that way, I should have noticed O:)

> >>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.
> >
> >    No, it doesn't work, but the strange thing is that vim barfs *only*
> >with 'showbreak'. I have latin1 (well, utf-8 now) characters in the
> >script, namely in 'foldtext' and 'listchars' at least, and they are
> >processed correctly. Maybe the codes I'm using are considered printable
> >in latin1 and nonprintable in utf8?
> 
> What characters are seen as printable in Vim depends on the 'isprint' 
> option.

    Oh, I didn't remember that, I assumed that Vim was using the
"isprint()" functions in ctype for that.

> That option's default is OS-dependent, but apparently not 
> locale-dependent. ASCII characters from 0x20 (space) to 0x7E (tilde), 
> including all digits and letters, are always "printable", even if the 
> option doesn't mention them.

    Anyway, I have that option set to "@,161-255", so probably if I set
my encoding to utf8, the multibyte characters (division and left
guillemot) should be printable, but in this case looks like Vim doesn't
like them (it likes them on 'listchars', so the problem is not the
encoding, definitely).

> >    Oops, I think I know what's happening. I don't have an utf8 locale,
> >and I don't mean active, I mean *installed*, so if vim is trying to use
> >an utf-8 locale to see if a character is printable or not, it won't work
> >unless vim itself knows if some character is printable or not under
> >utf8. That's why the error is E595 and only shows with 'showbreak'. Vim
> >is considering the division sign and the left guillemot non printable
> >under utf8 encoding (which, BTW, is not right). Probably if I install an
> >utf8 locale, things will work OK. By now I'll leave 'encoding' as
> >default, 'fenc' and 'fencs' empty and will set utf-8 by hand when needed
> >(which is not very frequently for me).
> 
> There used to be a limitation on 'listchars', and possibly it still applies 
> to 'showbreak': the characters in that option had to be valid in the 
> current 'encoding'. If you change the 'encoding', the option may become 
> invalid in the new 'encoding'. If you use 7-bit characters in 'showbreak' 
> it should be OK in all 'encoding's.

    Yes, but if I set the encoding to utf8 and save the file *as* utf8,
then Vim should handle it, am I wrong?. Those characters will be valid
utf8 and will be printable :?

> >    Problem solved! Thanks a lot for everything, Tony :)
> >
> De nada, hombre.

    Do you know that with that kind of expressions you would pass as a
spanish native? Your spanish is much better than you think ;))) I'll try
to learn a bit of esperanto to correspond to your kindness :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
It's my PC and I'll cry if I want to... RAmen!

Reply via email to