login about faq

I tried now for 2 days and a few month before another few days. Now I have no more ideas. I trust, that you guys can help me out!

I receive emails with ChilkatEmail2

Dim eMail As ChilkatEmail2
Set eMail = bundle.GetEmail(i)
myMail = eMail.GetMime

and it works, but not for mails that are 8bit encoded.

I have 3 Testmails that contains same text with german vowels ü and ä:

1st: --------------010305030209020706010509
Content-Type: Text/Plain;
Content-Transfer-Encoding: Quoted-Printable

iso-8859-1,qp: B=FCcher =E4ndern

2nd: --------------010305030209020706010509
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit

utf8,8bit: Bücher ändern

3rd: --------------010305030209020706010509
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

utf8,qp: B=C3=BCcher =C3=A4ndern

In Thunderbird the content is displayed properly as in the 2nd with utf-8, 8bit.

But when I receive the mails with vb6/chilkat, they come in like this:

  • myMail at 1st mail: iso-8859-1,qp: B=FCcher =E4ndern
  • myMail at 2nd mail: utf8,8bit: Bücher ändern
  • myMail at 3rd mail: utf8,qp: B=C3=BCcher =C3=A4ndern

So, 1 and 3 are as expected, but 3 is wrong. VB6 can not handle unicode, but can handle ä,ö,ü as used in german nad other languages. So how to bring #2 to: utf8,8bit: Bücher ändern

My idea was to convert it after parsing. So I made this function:

Public Function DecodeMimeString(ByVal SourceData As String, ByVal Encoding As String, Optional ByVal charset As String) As String
    Dim crypt As New ChilkatCrypt2
    crypt.UnlockComponent ("hereismykey")
    crypt.CryptAlgorithm = "none"
    crypt.EncodingMode = Encoding
    crypt.charset = charset
    DecodeMimeString = crypt.DecryptStringENC(SourceData)
End Function

I pass iso-8859-1/utf-8 as charset to the function, and quoted-printable/8bit as encoding to the function. it works fine for quoted-printable, but #2 with 8bit result in this string: '^w^' instead of 'Bücher ändern'

So, now I really hope that you can give me good hints. I appreciate that very much. Pete

asked Apr 03 '15 at 04:22

Rucksacktrager's gravatar image


Make sure to test with the latest version of Chilkat.

If the MIME string returned by eMail.GetMime displays "Bücher ändern", then the problem has already occurred and won't be fixed by a further attempt to "decode".


answered Apr 06 '15 at 21:44

chilkat's gravatar image

chilkat ♦♦

Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: Apr 03 '15 at 04:22

Seen: 2,291 times

Last updated: Apr 06 '15 at 21:44

powered by OSQA