unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Daniel Martín" <mardani29@yahoo.es>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Eli Zaretskii <eliz@gnu.org>,
	 emacs-devel@gnu.org,  Fatih Aydin <fataydin138@gmail.com>
Subject: Re: Letter-case conversions in network protocols
Date: Sat, 08 May 2021 17:41:37 +0200	[thread overview]
Message-ID: <m1czu1b5ce.fsf@yahoo.es> (raw)
In-Reply-To: <jwvh7jd5os5.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Sat, 08 May 2021 09:47:56 -0400")

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	other threads:[~2021-05-08 15:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-08  9:50 Letter-case conversions in network protocols Eli Zaretskii
2021-05-08 10:20 ` Lars Ingebrigtsen
2021-05-08 13:47 ` Stefan Monnier
2021-05-08 15:41   ` Daniel Martín [this message]
2021-05-08 19:45     ` Lars Ingebrigtsen
2022-01-17  9:41       ` Fatih Aydin
2022-01-20  9:21         ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1czu1b5ce.fsf@yahoo.es \
    --to=mardani29@yahoo.es \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=fataydin138@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).