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

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

bug#38587: base64-decode-region breaks encoding


From: Juri Linkov
Subject: bug#38587: base64-decode-region breaks encoding
Date: Sun, 15 Dec 2019 01:31:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

>> 0. emacs -Q
>> 1. insert a non-ASCII char, e.g. ä
>> 2. select the region around the char
>> 3. M-x base64-encode-region
>> 4. select the region around the encoded text
>> 5. M-x base64-decode-region
>>
>> results in a broken text.  IOW, base64-encode-region and base64-decode-region
>> are not reversible, whereas their string counterparts are:
>>
>> (base64-decode-string (base64-encode-string "ä"))
>> => "\344"
>
> Well, that's not really reversible, either.

But when it's know that the source string was in UTF-8,
shouldn't it be reversible?  What is needed for that?

Maybe an additional CODING arg for base64-decode-region?

Or it would be enough to use the coding system of the
output buffer?





reply via email to

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