Archived Forum Post

Index of archived forum posts

Question:

Use CkString for base64 encoding

Dec 06 '12 at 09:22

Hi,

has anyone tried to use just CkString to convert unicode to BASE64? I tried this: CkString str_base64; str_base64.base64EncodeW(L"My data"); char* p_base64 = str_base64.getString();

But getting always an empty string. Thanks a lot for any hints.


Answer

Make sure to read the reference documentation at http://www.chilkatsoft.com/refdoc/vcCkStringRef.html

void base64Encode(const char *charsetEncoding);

In-place base64 encodes the string. Internally, the string is first converted to the character encoding specified and then base-64 encoded. Typical charsetEncoding values are "utf-8", "ANSI", "iso-8859-1", etc.