Subject: Re: bug#38587: base64-decode-region breaks encoding

From: Andreas Schwab <[email-masked]>
Date: Sun, 15 Dec 2019 09:56:18 +0100

On Dez 15 2019, Juri Linkov wrote:

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

BASE64 is defined on a sequence of bytes.  It doesn't make sense to
apply it to characters.

The input of base64-encode-region needs to be encoded into bytes and the
output of base64-decode-region needs to be decoded into characters.  If
you do that, you get a full reversible operation.

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

The coding system of the output buffer has nothing to do with the coding
of the data produced by base64-decode-region, just like
process-coding-system is independent from the coding system of the
process buffer.

Andreas.

-- 
Andreas Schwab, [email-masked]
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."