Skip to content
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

Adjust mime encoding #230

wants to merge 1 commit into from
Changes from all commits
File filter

Filter by extension

Filter by extension

Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -34,7 +34,7 @@ public class MimeText {

public static String encode(String raw) {
var quoteMatcher = encodePattern.matcher(raw);
return quoteMatcher.replaceAll(mo -> "=?utf-8?b?" + Base64.getEncoder().encodeToString(String.valueOf( + "?=");
return quoteMatcher.replaceAll(mo -> "=?UTF-8?B?" + Base64.getEncoder().encodeToString(String.valueOf( + "?=");

public static String decode(String encoded) {
@@ -29,7 +29,7 @@
class MimeTextTests {
void encode() {
assertEquals("=?utf-8?b?w6XDpMO2?=", MimeText.encode("åäö"));
assertEquals("=?UTF-8?B?w6XDpMO2?=", MimeText.encode("åäö"));