From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: What is a preferred charset? Date: Wed, 21 Nov 2018 17:48:37 +0100 Message-ID: <87r2fe4bru.fsf@gmx.net> References: <87zhu24h0b.fsf@gmx.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1542818926 5938 195.159.176.226 (21 Nov 2018 16:48:46 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 21 Nov 2018 16:48:46 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Andreas Schwab , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 21 17:48:42 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gPVg9-0001NS-JB for ged-emacs-devel@m.gmane.org; Wed, 21 Nov 2018 17:48:41 +0100 Original-Received: from localhost ([::1]:40187 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPViF-0002hn-EX for ged-emacs-devel@m.gmane.org; Wed, 21 Nov 2018 11:50:51 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53111) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gPVgK-0002T0-Cx for emacs-devel@gnu.org; Wed, 21 Nov 2018 11:48:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gPVgH-0003jK-Px for emacs-devel@gnu.org; Wed, 21 Nov 2018 11:48:51 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:55861) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gPVgA-0003cz-2q; Wed, 21 Nov 2018 11:48:43 -0500 Original-Received: from rosalinde ([178.6.147.239]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lhwgc-1fda0C0HpK-00n7Wo; Wed, 21 Nov 2018 17:48:38 +0100 In-Reply-To: (Andreas Schwab's message of "Wed, 21 Nov 2018 16:24:26 +0100") X-Provags-ID: V03:K1:L+qAVBTsCjrdJabYBn/qX35offqAZMLIy9+PlXyAj1Agi+Pjebl +dulOa1ScW4uzSFW9SlgtQOtyfDNA+70TjwPR+HF5oqFpHLcGTb5WHyXLgTEmC+6Pxvcq8W PnxVSkYc6gFTmj2Jp+hymbQCR2lH+VOLSpC0DPTxST5ZUtY9ces6XlAN0OGz0QbhAUmuvGg EqekG56LhPqn57wwUl5Ng== X-UI-Out-Filterresults: notjunk:1;V03:K0:ghnxiPkDzU8=:K4EM/M4KBkSehCKpkUcZZO CcKmiXQlZpQU/+ifrnhgeprXHXBD3l5BmkkNtU5LVempXqtYfGxur26/d4TrAiIESb6xufJOg XlNwfcYWbOST5zi59Vlwy2mWxQFu1goMYKsH8ymn73lqzPtvLFhGOOme8VA/uz2RiuXzRYFyU AAoUDLPZpk/qHSKyq7h2ItUG00GGH1fFD4m1UMnP02yJZ4x/a5hibig8PmiOUjwF+UkG10Cgr wVcjVsF/dOr+eicaxNEcJDbBw8iFVIcgA3fRl6kw7tQRtwYs8mPKJpA8ykekmDQpoihv+Y9pr sfJRJoj6mw4e7PH2+J+8ga/utwycfcPCQQTeaYT1xxvVaHaUl+vB+6UNvetNINfQpDMJBxeNi 1Ib54FAdkoaU28OWRVjV/cxA3KM/mPRpFprGhU2xp/HMqUo5LMFCKm20/u0K3vuCYMX/lXqhi GnvxlBohskqOLvPzG2xszcZbelplgrzdep0sdFqChBHh2ttZs0KIU4VGupqcUdy/+SCOxoL8j nEk1UcHcQ11Z2oUQmRiS++lzr++BW0u+U1CZILvityTqIfTHqVVtQAJJRDBICmYzml6l9o1wd tbHtWTyz+a6LNb+pYXGu4BfgE+zmIBQ5SBrWl8P/qsf5e7H03DzRQK8gUQoJfve4b4XeuzfRu sPM8gDaqOhd84z6gQeJKe3aeKs2T3gtZSgi27CpO53OH8ORllozldBR8EG8m82dnqxtD43hd5 XxeI7qHhrWBmiVEDnp4E6QCjwCPqaHTD+vW4EeCKXquUT1ubpfj4fxe0voIXj+VY09VAK2l8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.15 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231297 Archived-At: On Wed, 21 Nov 2018 16:24:26 +0100 Andreas Schwab wrote: > On Nov 21 2018, Stephen Berman wrote: > >> The discussion in bug#33445 made me realize that I don't know what >> distinguishes a preferred charset from other charsets > > It's the first from (charset-priority-list) that can encode the > character. The priority is defined by the language environment. On Wed, 21 Nov 2018 17:37:07 +0200 Eli Zaretskii wrote: > "Preferred" is used there in the sense of "highest priority". See > charset-priority-list, set-charset-priority, and char-charset. They > are described in the node "Character Sets" of the ELisp manual. > > I guess someone tried to say "highest-priority" in fewer characters, > to avoid making the line too long. I had read that section of the manual before posting and at first did conclude that preferred meant highest priority, but the output of describe-char in HELLO seemed to conflict with that: >> For example, etc/HELLO uses the non-standard text/enriched >> annotation "x-charset" to make `describe-char' show >> "latin-iso8859-1" as the preferred charset of INVERTED EXCLAMATION >> MARK (#xa1), whereas when I use `C-x 8' to enter that character in a >> buffer `describe-char' says its preferred charset is "unicode". Why >> are there different preferred charsets in these cases and what's the >> significance and use of that difference in general > > When text has the 'charset' property, we show its value as the > highest-priority charset of the characters having that property. This > property is described in "Explicit Encoding". On my system (where the value of locale-coding-system is utf-8-unix) the first entries in charset-priority-list are: ascii iso-8859-1 unicode latin-iso8859-1 ... And calling char-charset on the character named INVERTED EXCLAMATION MARK returns "unicode" here. That accords with what you both wrote above about highest priority, but... > In the case of HELLO, each hello phrase was given the 'charset' > property corresponding to its language's script, so as to instruct > Emacs to choose the most appropriate font for that greeting. ...this seems to be a different criterion for preferred, not the highest priority as defined above, but (maybe) the smallest charset able to encode the character? >> and should it be documented? > > Now that you know what this is about, you tell me ;-) I'm still not sure. Steve Berman