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;