[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62919] base64_decode() cannot decode base64_e

From: Markus Mützel
Subject: [Octave-bug-tracker] [bug #62919] base64_decode() cannot decode base64_encode() content
Date: Fri, 19 Aug 2022 10:37:26 -0400 (EDT)

Update of bug #62919 (project octave):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 
        Operating System:               GNU/Linux => Any                    


Follow-up Comment #1:

Confirmed with Octave 7.2.0 on Windows.

However, as the documentation states:
> Encode a double matrix or array x into the base64 format string s.

So, it is only meant to work for *double* matrix input (not *int8* like in
your example).

The following (Matlab compatible) functions work for me for the input in your

result = matlab.net.base64encode (int8 ('[0,1,2]'))
char (matlab.net.base64decode (result))

However, that is a new function in Octave 7.

In older versions, the workaround is a bit more involved:

result = base64_encode (typecast ([input, zeros(1, 8-mod(numel(input), 8))],
char (typecast (base64_decode (result), 'int8'))

You might still need to strip padding zeros from the result at the end.

Anyway, closing as invalid because this is not supposed to work according to
the function documentation.


Reply to this item at:


Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]