From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Letter-case conversions in network protocols Date: Sat, 08 May 2021 09:47:56 -0400 Message-ID: References: <83h7jda71o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28161"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: emacs-devel@gnu.org, Fatih Aydin To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 08 15:48:52 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lfNK8-0007B1-45 for ged-emacs-devel@m.gmane-mx.org; Sat, 08 May 2021 15:48:52 +0200 Original-Received: from localhost ([::1]:37228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lfNK6-0008Ba-9I for ged-emacs-devel@m.gmane-mx.org; Sat, 08 May 2021 09:48:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfNJK-0007V6-Mt for emacs-devel@gnu.org; Sat, 08 May 2021 09:48:02 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:43304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lfNJI-0000Jy-B4; Sat, 08 May 2021 09:48:01 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2D6F6441495; Sat, 8 May 2021 09:47:59 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id D29C144093A; Sat, 8 May 2021 09:47:57 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620481677; bh=JMluRc7jd1rNxJUzKp8HKaKBQ317BQWik8+o+dpygyQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=ZKS9Mgwp5Dlmp8i+NSczaoMXmmvAaD3Cq2apGQGCJfkI+gTUXyw0lD6aG/sTxQb1h YtiP2OYmC3J4t2CmLpR+vWNmCLB8qcoSzxBrrEvBWIuJevVHqXPcYsSLG2PBAkfzKD 7hik7sZYEKqe7UPz/peoPud2vcCD1GVjTas/yktnnhlw7rMvZPYTdZMccE2RZjRXBy WlIfUG/SXKiHG/aA/fTLPPsa7HytOfup9a1aZm4KuOnPi8F+wAZ6NJLa7DxHaDBFki wpB1EkJymBXcTvy2ETaZJVZyuseA86hBcRJQs9kfcE9vFVOPhsIsjYUSC3Pq479d1a MK8vaNR1KryvQ== Original-Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 933DC1202BE; Sat, 8 May 2021 09:47:57 -0400 (EDT) In-Reply-To: <83h7jda71o.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 08 May 2021 12:50:11 +0300") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:269048 Archived-At: > 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 `=C4=B1`, ` should all belong to the same equivalence class and this normalization function should hence return the same value for all three. Stefan