diff --git a/src/main/java/org/perlonjava/runtime/perlmodule/MIMEQuotedPrint.java b/src/main/java/org/perlonjava/runtime/perlmodule/MIMEQuotedPrint.java index 800a76397..42d9a5b7e 100644 --- a/src/main/java/org/perlonjava/runtime/perlmodule/MIMEQuotedPrint.java +++ b/src/main/java/org/perlonjava/runtime/perlmodule/MIMEQuotedPrint.java @@ -110,7 +110,8 @@ private static String encodeQuotedPrintable(String input, String eol, boolean bi // Check if adding this token would make the line too long // We need to leave room for the '=' of a soft break, so max is 75 - if (currentLength + token.length() > 75) { + // Empty EOL means Perl's "no soft breaks" mode (binary charset encoding only). + if (!eol.isEmpty() && currentLength + token.length() > 75) { // Need to break the line output.append(currentLine).append("=").append(eol); currentLine = new StringBuilder(token);