bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#55727: 29.0.50; Incorrect zero symbol transcoding between applicatio


From: Eli Zaretskii
Subject: bug#55727: 29.0.50; Incorrect zero symbol transcoding between applications
Date: Mon, 30 May 2022 17:06:02 +0300

> From: Петров Андрей <an.petrov@pay-lab.ru>
> Date: Mon, 30 May 2022 13:08:52 +0000
> 
> 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.

Yes.  And it's a feature.  From select.el:

      ;; Most programs are unable to handle NUL bytes in strings.
      (setq str (string-replace "\0" "\\0" str))





reply via email to

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