Ron Aaron wrote:

> On Friday, May 31, 2013 12:27:21 PM UTC+3, Bram Moolenaar wrote:
>  
> > I find it a bit annoying that Unicode has two forms for the same character.
> > They should have made a choice to either use a base character plus composing
> > characters, or the combined form.  Now we need to solve this in software
> > everywhere.
> 
> Believe me, you're not the only one who finds it annoying!
> 
> > Perhaps iconv has a way to specify decomposing characters?
> > But we don't want to convert everything.
> 
> I didn't see any way, but maybe someone else knows?  
> 
> > I suppose decomposing is not an algorithm but a matter of a very big
> > table.
> 
> Yes, though perhaps not such a big table.  It's just the "equivalence"
> characters.  Hmm... actually there are a number of those, aren't
> there? Not just Hebrew but combined Latin chars as well.  ARRRRGH.
> 
> I could solve the problem for Hebrew, specifically, with a small
> table.  But I assume that would not be a solution you would favor.

It's OK to have a table, if it can be generated from the tables that
Unicode publishes.  We already have $VIMRUNTIME/tools/unicode.vim

I suppose what we want is to decompose characters, then we can use \Z to
ignore composing characters.  So we would use the decomposed form as a
kind of normalization.  Doing it the other way around doesn't sound very
useful, and doesn't work when the composed character does not exist.

Note that this would also work for Latin characters, and in effect you
get something similar to character classes.  So any "e" with an accent
that is one character would become an "e" with a composing character,
and then adding \Z makes the composing character be ignored.

-- 
What a wonderfully exciting cough!  Do you mind if I join you?
                -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" 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

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Raspunde prin e-mail lui