Chinese Character String Literals in VC++ 8, 9, 10, …

It is possible to use string literals within your C++ code — as long as you save your C++ source file using the utf-8 character encoding.

For example, open a .cpp source file and add this line:

	CkString str1;

When you try to save the .cpp source file, you may get a message such as:

“Some Unicode characters in this file could not be saved in the current codepage. Do you want to resave this file as Unicode in order to maintain your data?”

Click on the “Save with Other Encoding” button on the dialog box that pops up, and then select “Unicode (UTF-8 with signature) – Codepage 65001” for the encoding.

You may use the Unicode string in a Chilkat object like this:

int _tmain(int argc, _TCHAR* argv[])
	CkString str1;

	CkEmail email;

	// Tell the Chilkat object that the bytes pointed to by
	// "const char *" are utf-8:

	// Set the email's subject:

	// Set the email's body:

	// Let's use the big5 charset for the email...


	return 0;