login about faq

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.

asked Dec 05 '12 at 12:20

tkuprat's gravatar image

tkuprat
1112


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.

link

answered Dec 05 '12 at 13:09

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Thanks a lot for the quick answer. I read the documentation. But I expected to input the text in right encoding as used by the string itself. It works now. But I still can't understand why to set the character encoding of the string stored in my ckstring object again. Thanks a lot for your help!

(Dec 06 '12 at 09:22) tkuprat
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×65
×13
×11

Asked: Dec 05 '12 at 12:20

Seen: 1,805 times

Last updated: Dec 06 '12 at 09:22

powered by OSQA