Archived Forum Post

Index of archived forum posts

Question:

Email.QEncodeString does not work properly with some unicode characters

Dec 14 '15 at 10:23

We are using latest version of chilkat-x64.9.5.0.54 NuGet package in our .NET 4.5 application written in C#.

Example code:

var encoded = new Email().QEncodeString("👣", "utf-8");

The footprints is a 4-byte UTF-8 character (http://www.fileformat.info/info/unicode/char/1f463/index.htm)

What did I get?

"=?utf-8?Q?=ED=A0=BD=ED=B1=A3?="

What did I expect?

"=?utf-8?Q?=F0=9F=91=A3?="

For some reason, the QEncodeString method does not recognize the character properly and encodes it as 6-byte string that fits "CESU-8" encoding (?) and not UTF-8.

I've checked and such code:

var bytes = System.Text.Encoding.UTF8.GetBytes("👣");

returns expected values (0xF09F91A3).

We use QEncodeString to produce subjects for our emails. Because of the problem described above, some unicode characters are not displayed properly in email clients.

Are we doing something wrong?