From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: emacs-26 8f18d12: Improve documentation of decoding into a unibyte buffer Date: Tue, 28 May 2019 19:44:15 -0400 Message-ID: References: <20190525191039.14136.23307@vcs0.savannah.gnu.org> <20190525191040.CCD6C207F5@vcs0.savannah.gnu.org> <88F01F35-BE24-4F6E-B832-64AFE28CD06B@gnu.org> <83woiazjyo.fsf@gnu.org> <83muj6z9s4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="253996"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed May 29 01:44:39 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hVlll-0013yI-QZ for ged-emacs-devel@m.gmane.org; Wed, 29 May 2019 01:44:37 +0200 Original-Received: from localhost ([127.0.0.1]:44242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVllk-0004gY-PW for ged-emacs-devel@m.gmane.org; Tue, 28 May 2019 19:44:36 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:59159) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVllV-0004gP-Sq for emacs-devel@gnu.org; Tue, 28 May 2019 19:44:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVllU-0001DK-Ui for emacs-devel@gnu.org; Tue, 28 May 2019 19:44:21 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47960) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hVllT-0001Ce-Gq; Tue, 28 May 2019 19:44:19 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id E6FF9442D56; Tue, 28 May 2019 19:44:18 -0400 (EDT) Original-Received: from mail02.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B63E2442D54; Tue, 28 May 2019 19:44:17 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1559087057; bh=z+saYlLMC/9O8ea3J+ZbVKv1cLu67wqyQtpdXIK5msQ=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=O0t2cgVD8A4AlBe0C053LnJSeb3ISzVET9X7ew0/gDS0MX8VCBYMLdETqPy/GVuLa cDMiqPCvhDAImZAf6fMeTqntLXRY1SrHSSTH6A+Ehm/ha7OtngRpfg8ifd2c+MsUO8 Q1ru4tQdE4GP2OYkr7XJMZIRu3Uf1MOufKKmTyXdObvAb0qDjsPNz46oYe3F2PEaWZ 9OHqkqToWhqz0/cm/fdlehjsEseOn2jjSOFXrlinaj0EcBUxcSbuXFkTlTnDscjBJX DLeaCXQc8lh2vlbI8gzD80FiUpXYJv/2G9ig/qj5Lsxq3IVJi3KL3EAa/QLRW9zuh2 Vhkz+XmTqr9uA== Original-Received: from ceviche (192-171-44-92.cpe.pppoe.ca [192.171.44.92]) by mail02.iro.umontreal.ca (Postfix) with ESMTPSA id 809E11207A8; Tue, 28 May 2019 19:44:17 -0400 (EDT) In-Reply-To: <83muj6z9s4.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 28 May 2019 21:58:03 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 132.204.25.50 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:237133 Archived-At: >> I think this is an error. The patch below seems in order. > > I'm not sure. Be sure to read the comments about the tricky business > of this function, and the method it employs to solve it, and be sure > you understand all of the subtleties there. This only applies to the case where `char` is not ASCII. I installed a slightly more conservative patch which should make sure the returned string is always unibyte and that also fixes the ebcdic case at the same occasion. >> AFAIK it only happens for pure-ASCII strings. > What is your reasoning? For one, the docstring says that, pretty much. But also the fact that `undecided` implies that any coding system should be applicable, IOW `char` is in the intersection of all the coding systems we have, so it can only happen if the string is pure ASCII (since one of the coding systems is `us-ascii`, the insection cannot be larger than that. That doesn't preclude a non-undefined return value for some pure ASCII strings, admittedly, tho the docstring suggests that any ASCII string just returns `undecided`). Stefan