Monday, August 20, 2012

Re: Vim perl highlighting doesn't understand UTF-8?

On Mon, 20 Aug 2012, Linda W wrote:

> Linda W wrote:
>> 920 sub ƒshow_progress($) {
>> 921 #my $p = shift if ref $_[0];
>> 922 my $paths = $_[0];
>>
>> But the 'ƒ' in ƒshow_progress ends up being highlighted in red [ as
>> meaning incorrect syntax]. Is there a way to tell the vim syntax
>> checker to allow UTF-8.
>
> Does the lack of response indicate that perl-syntax on vim can't
> easily support UTF-8?

Possibly. Another possibility is that Perl-syntax gurus use the
Perl-specific Vim group: https://groups.google.com/group/vim-perl

There's also the fact that UTF-8 isn't widely used in Perl identifiers.
Despite the option's availability, inertia means that programmers tend
to stick with backwards-compatible ASCII identifiers. (I've been mostly
out of the Perl game since 5.12.x, but I certainly stuck to ASCII id's
to stay compatible.)


> Sorta weird -- vim supposed to be in UTF-8, perl as well, but UTF-8
> source gets complicated... Ya gotta wonder about claims of UTF-8
> compat when it's so hard to get basic parts of the UTF-8 alphabet not
> to be flagged as errors.

Vim's regular expressions aren't great for character sets that don't fit
into (single) 8-bit characters. Character classes aren't fully
Unicode-aware. (\h, \w, and related character classes don't handle
Unicode.) Because of that, syntax highlighting isn't easy to extend to
Unicode.

I'll take a stab at it if I get some "tuit's", but no promises.

--
Best,
Ben

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment