GNU bug report logs -
#60872
29.0.60; emacsql broken after Jan 12 change
Previous Next
Reported by: emacs18 <at> gmail.com
Date: Tue, 17 Jan 2023 04:51:01 UTC
Severity: normal
Found in version 29.0.60
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #20 received at 60872 <at> debbugs.gnu.org (full text, mbox):
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: Jonas Bernoulli <jonas <at> bernoul.li>, emacs18 <at> gmail.com,
> 60872 <at> debbugs.gnu.org
> Date: Tue, 17 Jan 2023 14:10:13 +0100
>
> This fails:
>
> (coding-system-for-write 'utf-8-auto)
> (coding-system-for-read 'utf-8)
>
> This works:
>
> (coding-system-for-write 'utf-8)
> (coding-system-for-read 'utf-8-auto)
>
> Eli> Anyway, it sounds like someone else thought utf-8-auto is about EOL
> Eli> format? Setting coding-system-for-write to utf-8-auto makes no sense;
> Eli> that coding-system's _only_ raison d'être is for using in
> Eli> coding-system-for-read, i.e. when decoding stuff that may or may not
> Eli> start with a BOM.
>
> Is it enough of an error for us to silently replace `utf-8-auto' with
> `utf-8' when itʼs specified for `coding-system-for-write'?
That's what the bug I fixed effectively did. But no, I don't think
this is something we can do, let alone silently. It could be that
some extremely rare/obscure, but nevertheless legitimate use case does
really want to produce BOM on encoding.
> Eli> If indeed there's sometimes a need to send to the process stuff that
> Eli> is encoded in UTF-8 with BOM, then instead of binding
> Eli> coding-system-for-write around start-process, you should set it using
> Eli> set-process-coding-system only _after_ the process starts, because the
> Eli> way the code is written now, utf-8-auto is also used to encode the
> Eli> command-line arguments to the sub-process, and so, for example,
> Eli> fullfile (which I presume is a file name?) gets the BOM prepended, and
> Eli> I'm guessing the program emacsql-sqlite isn't prepared for that, and
> Eli> exits abnormally.
>
> Either that or use `make-process' directly and pass `:coding'
No, that will suffer from the same problem:
:coding CODING
If CODING is a symbol, it specifies the coding system to be
used for both reading and writing of data from and to the
connection. If CODING is a cons cell ‘(DECODING . ENCODING)’,
then DECODING will be used for reading and ENCODING for
writing. The coding system used for encoding the data written
to the program is also used for encoding the command-line
arguments[...]
This bug report was last modified 2 years and 181 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.