Is this behavio(u)r intended?
...
uses
System.NetEncoding;
...
var
s: String;
begin
s := TNetEncoding.Base64.Encode('asjjdhgfaoösjkdhföaksjdfhöasjdfhasdkjasdhfköajsjhdfajssssd');
end;
s contains a CR LF:
YXNqamRoZ2Zhb8O2c2prZGhmw7Zha3NqZGZow7Zhc2pkZmhhc2RramFzZGhma8O2YWpzamhkZmFq '#$D#$A' c3Nzc2Q=
The issue with this is that all my http calls return a bad request. The other party does not expect this.
In that case you can create an instance with the proper parameters yourself:
var
s: String;
base64: TBase64Encoding;
begin
base64 := TBase64Encoding.Create(0); // CharsPerLine = 0 means no line breaks
try
s := base64.Encode('asjjdhgfaoösjkdhföaksjdfhöasjdfhasdkjasdhfköajsjhdfajssssd');
finally
base64.Free;
end;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With