-
-
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
some combinations encoding/charset aren't supported #848
Comments
Looks okay to me?
Which parts of the second message are you talking about?
The I ran your test program and it correctly detected the charset of every text part (other than the text/css parts) correctly as UTF-8 or Shift_JIS and then you set the text/charset value and the textPart updated with the new charset infiormation. I don't understand what the issue is. The only parts in the FrameworkTest.2-modified.mhtml file that doen't have charset= parameters in the Content-Type headers are the ones that would have been set to UTF-8 if your code didn't ignore those parts: if (encoding == Encoding.UTF8)
{
//Console.WriteLine("Ignoring UTF8 Part");
break;
} |
That's because iso-2022-jp is treated different by the browser than Shift_JIS. If you change iso-2022-jp can map to codepage 50220 or 50222 which use different techniques for encoding. I can't seem to paste a screenshot of the System.Text.Encoding properties, but if you set a breakpoint in your program and inspect the Encoding you'll see that it has the following values: BodyName: iso-2022-jp I can make MimeKit override the HeaderName to use shift_jis, but this is the cause of the problem. |
thanks! |
Describe the bug
there is an issue when I try to replace the a text part's text.
using:
`
`
the text string being read looks fine, but after setting it back into the text part the text part's text becomes garbled in some cases.
I've created a sample project with 2 examples. the first one works, and the 2nd fails.
the sample writes to the output folder the original message and the message after processing.
btw - using
textPart.SetText("iso-2022-jp", text);
will work on the 2nd sample, but I have no way of obtaining the charset. this info isn't available anywhere in the TextPart, not even in textPart.ContentType.MimeType or the headers of the ContentType -- it just shows "text/html" without the charset info.
Platform (please complete the following information):
To Reproduce
Steps to reproduce the behavior:
Expected behavior
no <?> in rendered MHT
Code Snippets
If applicable, add code snippets to help explain your problem.
// Add your code snippet here.
Additional context
MimeKitTest.zip
Thanks,
Oren
The text was updated successfully, but these errors were encountered: