From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] * etc/NEWS: Announce addition of BOM to utf-8-auto Date: Mon, 30 Jan 2023 16:16:12 +0200 Message-ID: <83y1pk3y6r.fsf@gnu.org> References: <837cx56vpc.fsf@gnu.org> <83y1pl5dwx.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30445"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Tom Gillespie , Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 30 15:17:06 2023 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 1pMUy0-0007ZF-CY for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Jan 2023 15:17:04 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMUxK-0003Og-UP; Mon, 30 Jan 2023 09:16:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMUxI-0003LM-Gy for emacs-devel@gnu.org; Mon, 30 Jan 2023 09:16:20 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMUxH-0000yq-Ea; Mon, 30 Jan 2023 09:16:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=yFgRNn5MGoNgbjA+DDF3hBrXzw/7RG+Ud5OouC5cl98=; b=DnMoQb/OqlFN Lk7uZ/FSuLZ6S9r57t3jvgjWXp/UxlwOztK38R5wD5yC+1YKDshwef+jvMThS5eNol+5pHqDuF845 IIjttANhT+2x7yfSgszB+B3jT9CV+A+f7evYSG+cTM0pV6QdaMChIR4XyF8SEQyRY3r+mwe9wuKAv RZYTlZF5MimnNyeqR+l7mbULTscUXpYpoUAm5gfo3gBzUm3oVmpvD55U1Ws12XFNM+FE1W9MW1dP2 /oo+6PiQp8X3u3WUjkAQBR79kIZOzAoi6Fy/ZTpFo87rpKVAlVeMo8XwXDsacRXQyBC4oGgbzi2kC gwYJDwzYRcj5/yA5EPawsg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMUxG-0007dx-Tj; Mon, 30 Jan 2023 09:16:19 -0500 In-Reply-To: (message from Tom Gillespie on Sun, 29 Jan 2023 14:56:11 -0500) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302784 Archived-At: > From: Tom Gillespie > Date: Sun, 29 Jan 2023 14:56:11 -0500 > Cc: emacs-devel@gnu.org > > > Encoding with 'utf-8-auto' now correctly produces a byte order mark. > > Much better. > > > Maybe (you assume that people really read all the small print in > > NEWS?). But first, could you explain why on earth are you using > > utf-8-auto _on_encoding_? It basically makes no sense at all. > > Hah, no, I don't think many people do, but maybe the maintainers > of some of the more widely used packages might? I'll dwell on this. > If I had to guess this issue is probably the result of people > copying what is done in async.el where there is a comment > that reads: > > ;; FIXME: Why use `utf-8-auto' instead of `utf-8-unix'? This is > ;; a communication channel over which we have complete control, > ;; so we get to choose exactly which encoding and EOL we use, isn't it? > > https://github.com/jwiegley/emacs-async/blob/270c3d0bd99386dd9a8538990401993a6a3cb1bc/async.el#L201-L203 > > Which suggests that your account of the confusion is exactly the issue. > > However there is also a comment about it somehow mitigating issues > with strings that have EOFs in them?? Is this even true? > > ;; Just in case the string we're sending might contain EOF > (encode-coding-region (point-min) (point-max) 'utf-8-auto) > https://github.com/jwiegley/emacs-async/blob/270c3d0bd99386dd9a8538990401993a6a3cb1bc/async.el#L222-L223 I think both of these are mistakes of the kind I described. I filed an issue with emacs-async, but someone should probably fix the one we have in ELPA. Stefan?