From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tom Gillespie Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] * etc/NEWS: Announce addition of BOM to utf-8-auto Date: Sun, 29 Jan 2023 14:56:11 -0500 Message-ID: References: <837cx56vpc.fsf@gnu.org> <83y1pl5dwx.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27857"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jan 29 20:57:19 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 1pMDnj-00075s-34 for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Jan 2023 20:57:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMDmu-00035t-60; Sun, 29 Jan 2023 14:56:28 -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 1pMDms-00035G-HC for emacs-devel@gnu.org; Sun, 29 Jan 2023 14:56:26 -0500 Original-Received: from mail-yb1-xb2f.google.com ([2607:f8b0:4864:20::b2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMDmq-0003Gb-BH; Sun, 29 Jan 2023 14:56:25 -0500 Original-Received: by mail-yb1-xb2f.google.com with SMTP id d132so11804889ybb.5; Sun, 29 Jan 2023 11:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=AxW0Jw5GwP5HjjLUCu2S3Bd6xkLWElevLajJAz8VgD8=; b=UENjS0ZyUyGZmHdocaWMmApwKyZJfutcDzk1f4yugE5Z/qA1n7qbWnd3CLTgpUfzGS 9N2FjqULevgvmrvZ3AcIsiZg4moO92hIdRlSIRIB9FfNOQNWKqfrHhiRcA8vioxfd5sS c9K0RCKjKBL7fe+aHvmCr7Z4BXPDu6wz+gDdtdDBQUiQVFIbtgVL6N/vxjG2R21eQC6a 1t4BYHlVG4eb+BNfS3eSZovNZ8pNqrm+BlsAjOdyFl+tt86l4/jLQLybZO5+OHApH1W7 C1RBOcAk82F3ektcvL+A2I3DRrZsNHwl7O7AM5O5FeOrGcA9scwVeDOYp1HOHSmQDWQ5 McKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=AxW0Jw5GwP5HjjLUCu2S3Bd6xkLWElevLajJAz8VgD8=; b=TE+Vm41X3EvCp0xHoD7eQ7tQRIyBwcB0WlPIfLjxfHv/FOVpUHv4t+VeBzZmT9bmCq 1yNGgcha6jzLA6vKtwKa63XkN2s4wHsxLFnYlghTeEZpHjPH06aLjY6ybgR3828qjx90 GNLzvwUoflL7B9DNXLSQ0b/6Afk/7kzuUntHG+4aOuN1btq6h+fEu9XjHMXP2XQzl4QD YyylILG2nEQJhBvvWvXtZhnJVZ0NPjZQmMUjQGeiE0opWLHHvMvnhtjMd/O5E/6ImO3W gtO9QHPS5NRhlwq4UpA/R/59zSOAjCwmXaYkj7GCcB8SVJDLHoqyA6QiZJPAuWNBHNtW 6ZCA== X-Gm-Message-State: AFqh2kriJPivXPfVvYpKdfMXTeotrDk7qd5hHV7cB9sPnOkyEgMtOS8t 4BzwqmL96m6dt36ez1oNi3sKayuROcbh7ZdHOANkluHrAbY= X-Google-Smtp-Source: AMrXdXs5A5kwwDtRpM1SetZQWX2PKSUK5iuU2k3lxeMGocfeWvMWfEVwAv1dozt8Bo4xrEgD/MHEfzWhWA0vN0SHM1o= X-Received: by 2002:a25:dd44:0:b0:797:1fb4:22c8 with SMTP id u65-20020a25dd44000000b007971fb422c8mr4123602ybg.62.1675022182636; Sun, 29 Jan 2023 11:56:22 -0800 (PST) In-Reply-To: <83y1pl5dwx.fsf@gnu.org> Received-SPF: pass client-ip=2607:f8b0:4864:20::b2f; envelope-from=tgbugs@gmail.com; helo=mail-yb1-xb2f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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.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:302762 Archived-At: > 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 have no idea why they are using it on encoding. Having played with it, it produces absolutely insane results like multiple calls prepending multiple BOMs when the default coding system is not itself set to utf-8-auto (or something like that). Maybe an opportunity to add a line to the message that says "As a reminder, there are next to no cases where utf-8-auto should be used with 'encode-coding-' functions." or similar? > All the people who did that with whom I talked until now did it > because they thought the "auto" part was about the EOL format (CR-LF > vs Newline). Is that so in your case as well? I personally have never touched utf-8-auto, but I'm cleaning up existing bugs that have impacted me. 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