[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] * etc/NEWS: Announce addition of BOM to utf-8-auto

From: Eli Zaretskii
Subject: Re: [PATCH] * etc/NEWS: Announce addition of BOM to utf-8-auto
Date: Mon, 30 Jan 2023 16:16:12 +0200

> From: Tom Gillespie <tgbugs@gmail.com>
> 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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]