Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

May 3, 2007

Passing Unicode Strings to Chilkat C++ Methods and Properties

The Chilkat C++ static libs for VC6, 7, and 8 are Unicode capable, although it may not seem like it. The methods have arguments of "const char *", but not "wchar_t *". So how can Unicode be supported?

It’s easy: Each Chilkat class has a Utf8 property. You’ll find this in each Chilkat class’s definition:

	bool get_Utf8(void) const;
	void put_Utf8(bool b);

By default, the Utf8 property is false, which indicates that all "const char *" arguments are interpreted as ANSI character strings. If however the Utf8 property is set to true, then "const char *" arguments are interpreted as utf-8. (Utf-8 is the multibyte encoding of Unicode.)

The CkString class can be used to convert to/from utf-8, ANSI, wchar_t *, or other character encodings. Here are some examples:

http://www.example-code.com/vcpp/string.asp


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.