From: Eli Zaretskii <eliz@gnu.org>
To: Robert Pluim <rpluim@gmail.com>
Cc: 60872@debbugs.gnu.org, jonas@bernoul.li, emacs18@gmail.com
Subject: bug#60872: 29.0.60; emacsql broken after Jan 12 change
Date: Tue, 17 Jan 2023 15:58:10 +0200 [thread overview]
Message-ID: <83r0vt2rgt.fsf@gnu.org> (raw)
In-Reply-To: <87ilh5cnnu.fsf@gmail.com> (message from Robert Pluim on Tue, 17 Jan 2023 14:10:13 +0100)
> From: Robert Pluim <rpluim@gmail.com>
> Cc: Jonas Bernoulli <jonas@bernoul.li>, emacs18@gmail.com,
> 60872@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[...]
next prev parent reply other threads:[~2023-01-17 13:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-17 4:50 bug#60872: 29.0.60; emacsql broken after Jan 12 change Richard Kim
2023-01-17 10:02 ` Robert Pluim
2023-01-17 12:45 ` Eli Zaretskii
2023-01-17 13:10 ` Robert Pluim
2023-01-17 13:38 ` Robert Pluim
2023-01-17 13:58 ` Eli Zaretskii [this message]
2023-01-17 14:42 ` Robert Pluim
2023-01-17 14:54 ` Eli Zaretskii
[not found] ` <878ri13xt1.fsf@bernoul.li>
2023-01-17 17:35 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83r0vt2rgt.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=60872@debbugs.gnu.org \
--cc=emacs18@gmail.com \
--cc=jonas@bernoul.li \
--cc=rpluim@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.