-
-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fallback encoding for TextPart.Text #88
Comments
You shouldn't need to use a custom build, you can just use:
The |
I've just added |
Thanks for your comments. This means something else went wrong. I'm storing received messages in a database to be processed later.
Using MimeMessage.Load with the bytes from step 2 I get the garbled text problem. The problem disappears after converting the bytes to UTF8 using Encoding.UTF8.GetBytes... |
When I added the new Could you test the latest version of the |
The behavior is still unchanged. in TextPart.Text:
|
Can you give me an example of what you mean by "garbled"? |
Ah... ok, so I think the problem here is that Encoding.UTF8's default Decoder is configured to replace unknown bytes with that question mark character. |
… does not use a fallback char Fixes issue #88
I think this patch will fix things up for you. |
Fixed. Thank you! I would like to send you a holiday present from Germany. Are you into whisky? (not German whisky :) |
I don't drink, but thanks for the offer ;-) The "thank you" is plenty to satisfy me. |
OK, but I'll add some extra flattery next time :) |
Hello Jeff,
When no charset is specified for a TextPart MimeKit falls back to UTF8 and only if this throws to iso-8859-1.
We frequently receive emails with a TextPart having 8bit Content-Transfer-Encoding and no charset parameter.
In our case we must always directly decode using iso-8859-1 (UTF8 encoding garbles the text).
I'm currently using a custom build falling back to iso-8859-1 only, which is working well for us.
Maybe this case is too special, but If other MimeKit users have the same problem, it might be helpful to be able to specify a default fallback encoding.
Just wanted to give some feedback.
Alex
The text was updated successfully, but these errors were encountered: