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
Yet another encoding problem #429
Comments
Thx, @MMaus and looking forward to your PR! |
If the PR is okay, I can of course provide the corresponding one for master. |
I need to re-work this PR |
PR is open now - I hope the 1.6.x branch is okay, of course I can provide it for master as well |
PR looks good and please make PR against master. Thanks alot! |
I have now created an adapted version of this PR against master (just the imports in the test moved from javax.mail to jakarta.mail). |
When I run a GreenMail server (as Spring bean) in an application and send an utf-8 coded email with umlauts via Thunderbird, and then fetch that email again via Thunderbird, I might have the wrong encoding.
Whether or not this occurs depends on the encoding which is used for the JVM, i.e. running with -Dfile.encoding=iso-8859-1 works, but -Dfile.encoding=utf-8 does not work (contrary to what you would expect - I know).
I think I spotted the issue in the code - in
GreenMailUtil#getWholeMessage
treats everyString
as ISO-8859-1 encoded, and since it transformsbyte[]
intoString
(which is UTF-16 in Java), that's actually a conversion of data.I'm working on a PR to fix this, if that's okay.
Below is the received Mail after my test scenario; the actual message body should be "Täst"
The text was updated successfully, but these errors were encountered: