Sample code for 30+ languages & platforms
C

Example: Crypt2.DecodeString method

Demonstrates how to call the DecodeString method.

Chilkat C Downloads

C
#include <C_CkCrypt2.h>

void ChilkatSample(void)
    {
    HCkCrypt2 crypt2;
    const char *encodedStr;
    const char *encoding;
    const char *charset;
    const char *str;

    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);
    printf("%s\n",str);

    //  Output is "Hello World"


    CkCrypt2_Dispose(crypt2);

    }