Witam
znalazłem w internecie funkcję dekodująca base64:
Niestety funkcja ta nie dekoduje poprawnie podanego stringa. Podejrzewam, że ma to związek z przejściem na utf8 w nowszych delphi...
const
Codes64: array[0..63] of AnsiChar = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz+/';
function DecodeBase64(S: string): string;
var
i: Integer;
a: Integer;
x: Integer;
b: Integer;
ss: ansistring;
begin
Result := '';
ss := ansistring(s);
a := 0;
b := 0;
for i := 1 to Length(s) do
begin
x := Pos(ss[i], codes64) - 1;
if x >= 0 then
begin
b := b * 64 + x;
a := a + 6;
if a >= 8 then
begin
a := a - 8;
x := b shr a;
b := b mod (1 shl a);
x := x mod 256;
Result := Result + chr(x);
end;
end
else
Exit;
end;
end;