Subject: Re: bug#55727: 29.0.50; Incorrect zero symbol transcoding between applications

From: Eli Zaretskii <[email-masked]>
Date: Mon, 30 May 2022 21:09:49 +0300

> From: Петров Андрей <[email-masked]>
> CC: "[email-masked]" <[email-masked]>, "[email-masked]"
> 	<[email-masked]>
> Date: Mon, 30 May 2022 16:23:46 +0000
> 
> Hi, Eli!
> 
> Looks like I have to use hex, base64 or other ASCII encodings.
> It seems that I will use something like this:
> 
> (defun my-escape-char (c)
>   (insert (if (< c ?\s) (format "\\%03o" c) c)))
> 
> (print "000\000000" 'my-escape-char)

Emacs has base64-encode-region and base64-decode-region, so you could
use that instead.