Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Unicode, Korean, normalization form, Mac OS X and tab completion



On Sun, Jun 1, 2014 at 10:00 AM, Jun T. <takimoto-j@xxxxxxxxxxxxxxxxx>
wrote:

> There is a patch by a Japanese user which simply converts
> file names obtained by readder() into the composed form ("NFC"):
>         https://gist.github.com/waltarix/1403346
> The patch in this gist is against zsh-5.0.0 (I guess).
> I attached the same patch against the current git master below
> (I added defined(__APPLE__) to the #if condition).
>

Arigatoo gozaimasu!  (Watch me practice my limited and rusty Nihongo.)


> In the current zsh (without this patch),
> $ ls 가<TAB>
> doesn't work if 가 is input from keyboard (NFC), but works if it is
> pasted from the ls output (NFD). With the patch, the opposite happens.
>

This is as expected; both might work if patcompile() were also smart about
it.

For example, if you have a file named über
> in the current directory, with the current zsh (without the patch):
>
> $ ls u<TAB>     # completes to über (useful for some user??)
> $ ls ü<TAB>     # fails to complete
>
> and u* matches with über while ü* doesn't.
> With the patch, the we get the opposite behavior.
>

The current behavior here is pretty much by accident, because the
decomposed character for "ü" happens to be "u+umlaut" and (if I'm reading
this correctly) at the lowest level the pattern match is applied octet-wise
rather than character-wise, so "*" matches the umlaut and "u" is considered
a prefix.  Arguably the current behavior is wrong.


Messages sorted by: Reverse Date, Date, Thread, Author