Tcl Source Code

View Ticket
Login
Ticket UUID: 8edfcedfa0069658e4175e0fc7bcbecf01e06802
Title: binary encode base64 explodes multi-byte wrapchars
Type: Bug Created on: 2020-03-27 22:22:41
Submitter: dgp Assigned to: dgp
Subsystem: 12. ByteArray Object Severity: Important
Priority: 5 Medium Last modified: 2020-03-28 19:22:24
Status: Closed Closed by: dgp
Resolution: Fixed Closed on: 2020-03-28 19:22:24
Version: 8.6+
Description:
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
User Comments:
dgp added on 2020-03-28 19:22:24:
Fixed.