emacs-devel
[Top][All Lists]
Advanced

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

Re: Letter-case conversions in network protocols


From: Daniel Martín
Subject: Re: Letter-case conversions in network protocols
Date: Sat, 08 May 2021 17:41:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (darwin)

Stefan Monnier <monnier@iro.umontreal.ca> writes:
>
> This said, another approach is to improve our handling of case-fold: instead
> of applying `downcase` on both sides and checking that it gives the same
> result, we should be using a "normalization" function which will return
> "the representative" of a given equivalence class.  E.g. in a Turkish
> locale, `i`, `I`, and `ı`, ` should all belong to the same equivalence
> class and this normalization function should hence return the same value
> for all three.
>

I like this, but I think it should be a different option (say
`case-fold-culture-invariant-search' or something like that), because
both ways to perform case-insensitive comparisons have their purpose,
depending on the context.

Then we could audit instances where 'case-fold-search' is set to non-nil
in the codebase and see if replacing them with the culture-invariant
form would be TRT to avoid these kind of subtle bugs that can specially
affect our Turkish and Azeri users.

Of course, code can still be broken if people explicitly do its own
thing with `downcase', etc. instead of using the case-folding string
APIs, but that's sort of an anti-pattern, anyway.


reply via email to

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