Skip to content

System.NetEncoding.Base64.Encode is wrong

Summary

System.NetEncoding.Base64.Encode is wrong

System Information

  • Operating system: All
  • Processor architecture: All
  • Compiler version: 3.2.2
  • Device: Computer

Steps to reproduce

Example Project

What is the current bug behavior?

In fact, it performs decoding.

What is the expected (correct) behavior?

It should perform coding.

Relevant logs and/or screenshots

Possible fixes

function TBase64Encoding.DoEncode(const aInput, aOutput: TStream): Integer;
Var
  S : TBase64EncodingStream;

begin
  S:=TBase64EncodingStream.Create(aInput);
  try
    Result:=S.Size;
    aOutput.CopyFrom(S,Result);
  finally
    S.Free;
  end;
end;
Edited by Ghost User
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information