From 294cdc8637a003799ebef7e0e8d68361952147a2 Mon Sep 17 00:00:00 2001 From: "David M. Lloyd" Date: Wed, 4 Dec 2024 09:12:39 -0600 Subject: [PATCH] Fix header encoding regression Problem was introduced by #492. --- src/main/java/org/jboss/logmanager/handlers/WriterHandler.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jboss/logmanager/handlers/WriterHandler.java b/src/main/java/org/jboss/logmanager/handlers/WriterHandler.java index a3736162..d5abf0ed 100644 --- a/src/main/java/org/jboss/logmanager/handlers/WriterHandler.java +++ b/src/main/java/org/jboss/logmanager/handlers/WriterHandler.java @@ -180,7 +180,7 @@ private void writeHead(final Writer writer) { if (!head.isEmpty() && checkHeadEncoding) { Charset cs = getCharset(); // UTF-8 is always safe since the UTF-16 chars in String(s) are always encodable - if (!StandardCharsets.UTF_8.equals(cs) && cs.newEncoder().canEncode(head)) { + if (!StandardCharsets.UTF_8.equals(cs) && !cs.newEncoder().canEncode(head)) { reportError("Section header cannot be encoded into charset \"" + cs.name() + "\"", null, ErrorManager.GENERIC_FAILURE); return;