Skip to content

Commit

Permalink
Fix header encoding regression
Browse files Browse the repository at this point in the history
Problem was introduced by #492.
  • Loading branch information
dmlloyd committed Dec 4, 2024
1 parent eec624d commit 294cdc8
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 294cdc8

Please sign in to comment.