Sample code for 30+ languages & platforms
Delphi DLL

Example: Crypt2.DecodeString method

Demonstrates how to call the DecodeString method.

Chilkat Delphi DLL Downloads

Delphi DLL
uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Crypt2;

...

procedure TForm1.Button1Click(Sender: TObject);
var
crypt2: HCkCrypt2;
encodedStr: PWideChar;
encoding: PWideChar;
charset: PWideChar;
str: PWideChar;

begin
crypt2 := CkCrypt2_Create();

// The string "Hello World" in base64 (using the utf-8 byte representation) is "SGVsbG8gV29ybGQ="

encodedStr := 'SGVsbG8gV29ybGQ=';
encoding := 'base64';
charset := 'utf-8';

str := CkCrypt2__decodeString(crypt2,encodedStr,charset,encoding);
Memo1.Lines.Add(str);

// Output is "Hello World"

CkCrypt2_Dispose(crypt2);

end;