Archived Forum Post

Index of archived forum posts

Question:

Unicode attachment names

May 05 '14 at 07:06

Using C++, how do I attach a file to a CkEmail if it has a Unicode name that can't be converted to ANSI using the current code page? The only methods I see are AddFileAttachment and AddFileAttachment2, both of which use char* for the file name.


Answer

Thanks Sune! Yes, you can pass the strings as utf-8 ( see http://www.cknotes.com/utf8-c-property-allows-for-utf-8-or-ansi-const-char/ )

or you may use the Unicode (wchar_t) Chilkat classes which have names ending in "W" (such as CkEmailW) and use "const wchar_t " instead of "const char ".

In summary, Chilkat provides the option to pass ANSI (single-byte per char strings), utf-8, or wchar_t.