Fix Base64 madness for good
Hi, I propose the following: https://pharo.manuscript.com/f/cases/21870/Fix-Base64-madness-for-good https://github.com/pharo-project/pharo/pull/1331 This is a much needed cleanup, IMHO. It is a breaking change however, since it changes the signature (return type) of an existing method. #base64Decoded used to wrongly return a String, while that should be a ByteArray since Base64 encoding is a way to encode bytes as ASCII text, hence decoding it should give you back the original bytes. Sven
10/05/2018 16:42, Sven Van Caekenberghe wrote:
Hi,
I propose the following:
https://pharo.manuscript.com/f/cases/21870/Fix-Base64-madness-for-good https://github.com/pharo-project/pharo/pull/1331
This is a much needed cleanup, IMHO. It is a breaking change however, since it changes the signature (return type) of an existing method.
#base64Decoded used to wrongly return a String, while that should be a ByteArray since Base64 encoding is a way to encode bytes as ASCII text, hence decoding it should give you back the original bytes.
Those who were using these methods expecting a string can send #asString to the returned bytarray. Of course that would be wrong, but it would be "as wrong as before", and hence, compatible. So please go ahead and change it. Also, having a "proper" implementation in a live environment serves a teaching vehicle for those learning how stuff works. Regards, -- Esteban A. Maringolo
Am 10.05.2018 um 21:42 schrieb Sven Van Caekenberghe <sven@stfx.eu>:
Hi,
I propose the following:
https://pharo.manuscript.com/f/cases/21870/Fix-Base64-madness-for-good https://github.com/pharo-project/pharo/pull/1331
This is a much needed cleanup, IMHO. It is a breaking change however, since it changes the signature (return type) of an existing method.
#base64Decoded used to wrongly return a String, while that should be a ByteArray since Base64 encoding is a way to encode bytes as ASCII text, hence decoding it should give you back the original bytes.
Please do. It is obviously the right move. The times where strings contained bytes and it makes sense is over for a long time. Norbert
YESS! On Thu, May 10, 2018 at 10:33 PM, Norbert Hartl <norbert@hartl.name> wrote:
Am 10.05.2018 um 21:42 schrieb Sven Van Caekenberghe <sven@stfx.eu>:
Hi,
I propose the following:
https://pharo.manuscript.com/f/cases/21870/Fix-Base64-madness-for-good https://github.com/pharo-project/pharo/pull/1331
This is a much needed cleanup, IMHO. It is a breaking change however, since it changes the signature (return type) of an existing method.
#base64Decoded used to wrongly return a String, while that should be a ByteArray since Base64 encoding is a way to encode bytes as ASCII text, hence decoding it should give you back the original bytes.
Please do. It is obviously the right move. The times where strings contained bytes and it makes sense is over for a long time.
Norbert
-- Guille Polito Research Engineer Centre de Recherche en Informatique, Signal et Automatique de Lille CRIStAL - UMR 9189 French National Center for Scientific Research - *http://www.cnrs.fr <http://www.cnrs.fr>* *Web:* *http://guillep.github.io* <http://guillep.github.io> *Phone: *+33 06 52 70 66 13
participants (4)
-
Esteban A. Maringolo -
Guillermo Polito -
Norbert Hartl -
Sven Van Caekenberghe