Skip to content
Tcl Source Code View Ticket
Login

View Ticket

binary encode base64 explodes multi-byte wrapchars

Closed / Fixed8edfcedfa0069658e4175e0fc7bcbecf01e06802Created 7 years agoUpdated 7 years ago
Descriptionplain2020-03-27 22:22:41
TIP 317 created [binary encode base64].  Its options were not specified in fine
detail, but there was an apparent implicit understanding that the functionality
of the base64 package was being copied.

They are not consistent treating multi-byte -wrapchar values.

% package require base64
2.4.2
% puts \u00ca
Ê

% set code [base64::encode -maxlen 3 -wrapchar \u00ca abc]
YWJÊj
% base64::decode $code
abc

% set code [binary encode base64 -maxlen 3 -wrapchar \u00ca abc]
YWJÊj
% binary decode base64 $code
invalid base64 character "Ã" at position 3
Referenced by1
  • 3a67f13d0d[8edfcedfa0] [binary encode base64] build a string instead of a bytearray whenever it might be required to get the right result. check-in2020-03-28 19:21:56
dgpplain2020-03-28 19:22:24
Fixed.
Log in (anonymous is fine) to add a comment.