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

> The general problem that I'd like us to discuss is how to deal with
> letter-case conversions in code that deals with protocols, such as
> network-related protocols, that need to recognize certain keywords.
[...]
> Are there better solutions?  Ideas are welcome.

FWIW, I think the sanest way to solve this problem is to make sure
localization doesn't affect the case-mapping of ASCII chars.

I have no idea how "unacceptable" that is for someone using a locale
such as Turkish, tho.

To do better, we could add a separate nonascii case table and those
places in the code that manipulate "text" would then have to use

    (with-case-table nonascii-case-table ...)

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.


        Stefan




  parent reply	other threads:[~2021-05-08 13:47 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 [this message]
2021-05-08 15:41   ` Daniel Martín
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=jwvh7jd5os5.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=fataydin138@gmail.com \
    /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).