Skip to content

Commit

Permalink
Correct non-UTF8 handling in HtmlInputStreamReader
Browse files Browse the repository at this point in the history
This change corrects the code to set the right encoding in the case when
the external encoding has been determined to be non-UTF8.
  • Loading branch information
sideshowbarker committed Sep 2, 2021
1 parent 0de3e55 commit c5a88d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/nu/validator/htmlparser/io/HtmlInputStreamReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ public HtmlInputStreamReader(InputStream inputStream,
} else {
err(Encoding.msgLegacyEncoding(encoding.getCanonName()));
if (driver != null) {
driver.setEncoding(Encoding.UTF16, Confidence.CERTAIN);
// XXX Why did we do driver.setEncoding(encoding.UTF16... ?
driver.setEncoding(encoding, Confidence.CERTAIN);
}
}
}
Expand Down

0 comments on commit c5a88d6

Please sign in to comment.