GNU bug report logs -
#52670
legacy base64 encoding of latin-1
Previous Next
Reported by: mattiase <at> acm.org
Date: Sun, 19 Dec 2021 21:48:01 UTC
Severity: normal
Done: Mattias Engdegård <mattiase <at> acm.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 20 Dec 2021 20:24:21 +0100
with message-id <F2306D80-4D6B-41A8-992D-7E98D01667FA <at> acm.org>
and subject line Re: bug#52670: [PATCH] legacy base64 encoding of latin-1
has caused the debbugs.gnu.org bug report #52670,
regarding legacy base64 encoding of latin-1
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
52670: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52670
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
For what appears to be historical reasons, the base64 encoding functions (base64-encode-string etc) treat characters in the range U+0080..U+00FF as if they were raw bytes in the 127..255 range. This means that
(base64-encode-string "ÿ")
and
(base64-encode-string "\xff")
return the same result although the strings are completely different. Attempts to encode other multibyte characters fail (correctly). For example,
(base64-encode-string "Ÿ")
signals an error, as expected.
I propose we tighten up the behavior by eliminating the legacy handling of characters in the U+0080..U+00FF range. Letting the bug stay in place enables incorrect, brittle and error-prone usage: the functions are clearly intended to be fed encoded text only and should signal an error when not, as stated in the manual.
[Message part 3 (message/rfc822, inline)]
20 dec. 2021 kl. 20:10 skrev Eli Zaretskii <eliz <at> gnu.org>:
> Thanks, but this should at the very least be announced as an
> incompatible Lisp change in NEWS.
Right, I added a detailed notice. Thanks for taking a look!
Pushed; closing.
This bug report was last modified 3 years and 154 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.