GNU bug report logs - #55727
29.0.50; Incorrect zero symbol transcoding between applications

Previous Next

Package: emacs;

Reported by: Петров Андрей <an.petrov <at> pay-lab.ru>

Date: Mon, 30 May 2022 13:10:01 UTC

Severity: normal

Found in version 29.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 55727 <at> debbugs.gnu.org (full text, mbox):

From: Петров Андрей <an.petrov <at> pay-lab.ru>
To: Po Lu <luangruo <at> yahoo.com>
Cc: "55727 <at> debbugs.gnu.org" <55727 <at> debbugs.gnu.org>
Subject: Re: bug#55727: 29.0.50; Incorrect zero symbol transcoding between
 applications
Date: Mon, 30 May 2022 14:27:43 +0000
Hi, Po.

OK, You can close the bug then.

Just tell me if Emacs have ready to use solution for passing binary
strings between applications in a form what can be correctly restored
 with `read' function. I found that output of `print' also can not be
transferred through application boundary.

С уважением,
Андрей Петров,
программист ООО Инпас-Софт.


________________________________________
От: Po Lu <luangruo <at> yahoo.com>
Отправлено: 30 мая 2022 г. 18:42:51
Кому: Петров Андрей
Копия: 55727 <at> debbugs.gnu.org
Тема: Re: bug#55727: 29.0.50; Incorrect zero symbol transcoding between applications

Петров Андрей <an.petrov <at> pay-lab.ru> writes:

> Hello, team!
>
> Please check the following behavior:
>
> 1. Start two instances of emacs -Q.
> 2. Switch to the "*scratch*" buffer of the first one and type the following:
>    M-: (insert (format "%S"  "000\000000")) [RET]
>    You should see "000^@000" string.
> 3. Copy the string into clipboard and paste into the other instance of
>    Emacs (which you have started before).
>    I get "000\0000" instead of "000\000000"
> 4. Try evaluating inserted text ("000\0000")
>    C-c C-e
>    I get "000^@0" instead of "000^@000".
>
> It seems that "^@" is transcoded between applications into "\0"
>  instead of "\000". If I do the same test inside single instance
>  of Emacs I get the correct result.

That's not a bug.  Most programs cannot tolerate NUL bytes inside
selection strings, so the Emacs selection converter deliberately
replaces those inside a string with "\0" before sending the string to a
requestor.

When one Emacs instance owns the selection, the contents of the kill
ring are used directly when yanking text, so that conversion doesn't
take place.




This bug report was last modified 2 years and 355 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.