Skip to content

Commit

Permalink
Merge pull request #500 from dmlloyd/fix-he-reg
Browse files Browse the repository at this point in the history
Fix header encoding regression
  • Loading branch information
jamezp authored Dec 5, 2024
2 parents eec624d + 294cdc8 commit c45c59b
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 c45c59b

Please sign in to comment.