emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: case-insensitive string comparison


From: tomas
Subject: Re: case-insensitive string comparison
Date: Wed, 20 Jul 2022 06:39:46 +0200

On Tue, Jul 19, 2022 at 02:56:45PM -0400, Sam Steingold wrote:
> > * Mattias Engdegård <znggvnfr@npz.bet> [2022-07-19 20:06:50 +0200]:
> >
> > 19 juli 2022 kl. 19.27 skrev Sam Steingold <sds@gnu.org>:
> >
> >> (defun string-equal-ignore-case (s1 s2)
> >
> > What would you tell someone complaining that
> >
> >   (let ((rue "Straße"))
> >     (string-equal-ignore-case rue (upcase rue)))
> >
> > returns nil? Asking for a friend.
> 
> This is a well-known bug in user code.
> https://stackoverflow.com/q/319426/850781

One case (heh) which gets too little attention in that
(good) ref is "i" "ı" vs. "İ" vs. "I". You've to decide
on a language environment to get a chance of doing it
right (in Latin languages there are only 1 and 4, and
they map to each other, in Turkic languages 1 and 3
correspond, as 2 and 4 do).

The ref to the Unicode FAQ [1] from your ref shows that
even the Unicode folks have given up on that. To me, it
looks like an especially sleazy way to admit "well, folks,
we've messed up on this one".

Human languages are a messy mix, in which politics figures
prominently. Unicode reflects that.

Cheers
[1] http://unicode.org/faq/casemap_charprop.html#9
-- 
t

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]