Sample code for 30+ languages & platforms
Delphi ActiveX

Example: Crypt2.DecodeString method

Demonstrates how to call the DecodeString method.

Chilkat Delphi ActiveX Downloads

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

...

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

begin
crypt2 := TChilkatCrypt2.Create(Self);

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

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

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

// Output is "Hello World"
end;