Archived Forum Post

Index of archived forum posts

Question:

mime email without charset

Oct 18 '13 at 11:28

Hello,

i receive some emails and i use chilkat email ( or chilkat mime ) to read them, some of the email do not provide a charset

i think that the component treat them as windows 1252, is it the default charset ?

is there a way to detect the charset of the body of the email ( and the subject) if no charset is explicitly provided ?


Accepted Answer

I think the default charset if not explicitly provided is technically us-ascii. However, Chilkat will assume Windows 1252 (Latin1) because it is a superset of us-ascii. It is a slightly better choice than iso-8859-1 because the latter contains a few more "holes" in the charset (meaning byte values that represent no character whatsoever).

However, the Chilkat MIME parser, when encountering 8bit chars w/ no charset specified, will look for clues to decide the actual encoding used. It's rare to find a MIME document where Chilkat cannot get it correct, and if such a MIME document is found, it's typically because there is no possible way to surmise the correct actual charset encoding.