[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strcasecmp
From: |
Paul Eggert |
Subject: |
Re: strcasecmp |
Date: |
Wed, 14 Feb 2007 15:33:37 -0800 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Bruno Haible <address@hidden> writes:
> Paolo Bonzini wrote:
>> I'm not sure how Turkish people would do lowercase translation
>> of English words. In other words, I'm not sure if they'd write the
>> hypothetical language Iris as İRİS or ırıs.
>
> This is one question to ask. The other consideration is:
>
> If a script contains an invocation "bison --language=Iris" or
> "bison --language=iris", then the script will work in all non-Turkish locales.
> Therefore it should also work in Turkish locales; otherwise it's viewed as
> a bug.
>
> This consideration points to using
> (a) c_strcasecmp (a, b) or
> (b) c_strcasecmp (a, b) || mbscasecmp (a, b).
>
> If your Turkish friend says he would write "ırıs", then it points to (b).
(b) sounds error prone. I think one could come up with examples that
will work in the C locale but not work in some other locale, because
the wrong language (out of a hypothetical set) gets identified out of
Bison's builtin set.
(a) sounds safer. With (a), if someone comes up with a computer
language with a Turkish-language extension, I suppose they'll just
have to match its name exactly. That's good enough.
The only reason for the case-insensitive comparison here is support
for Windows-like file names, right? So the issue is not worth our
worrying about (except perhaps as a warning that we should avoid
case-insensitive comparison whenever we can :-).