Skip to content

Commit 622c90b

Browse files
Correct non-UTF8 handling in HtmlInputStreamReader
This change corrects the code to set the right encoding in the case when the external encoding has been determined to be non-UTF8.
1 parent 81c40ef commit 622c90b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/nu/validator/htmlparser/io/HtmlInputStreamReader.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,8 @@ public HtmlInputStreamReader(InputStream inputStream,
162162
} else {
163163
err(Encoding.msgLegacyEncoding(encoding.getCanonName()));
164164
if (driver != null) {
165-
driver.setEncoding(Encoding.UTF16, Confidence.CERTAIN);
165+
// XXX Why did we do driver.setEncoding(encoding.UTF16... ?
166+
driver.setEncoding(encoding, Confidence.CERTAIN);
166167
}
167168
}
168169
}

0 commit comments

Comments
 (0)