Skip to content

Commit 4a68e5c

Browse files
1 parent 77503d9 commit 4a68e5c

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,9 @@ public void tokenize(InputSource is) throws SAXException, IOException {
197197
tokenizer.getErrorHandler(), tokenizer, this, heuristics);
198198
} else {
199199
if (this.characterEncoding != Encoding.UTF8) {
200-
warnWithoutLocation("Legacy encoding \u201C"
200+
errorWithoutLocation("Legacy encoding \u201C"
201201
+ this.characterEncoding.getCanonName()
202-
+ "\u201D used. Documents should use UTF-8.");
202+
+ "\u201D used. Documents must use UTF-8.");
203203
}
204204
becomeConfident();
205205
this.reader = new HtmlInputStreamReader(inputStream,
@@ -416,14 +416,14 @@ public void setHeuristics(Heuristics heuristics) {
416416
* the message
417417
* @throws SAXException
418418
*/
419-
protected void warnWithoutLocation(String message) throws SAXException {
419+
protected void errorWithoutLocation(String message) throws SAXException {
420420
ErrorHandler errorHandler = tokenizer.getErrorHandler();
421421
if (errorHandler == null) {
422422
return;
423423
}
424424
SAXParseException spe = new SAXParseException(message, null,
425425
tokenizer.getSystemId(), -1, -1);
426-
errorHandler.warning(spe);
426+
errorHandler.error(spe);
427427
}
428428

429429
/**

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ public HtmlInputStreamReader(InputStream inputStream,
131131
if (encoding == null) {
132132
declared = false;
133133
} else if (encoding != Encoding.UTF8) {
134-
warn("Legacy encoding \u201C"
134+
err("Legacy encoding \u201C"
135135
+ encoding.getCanonName()
136-
+ "\u201D used. Documents should use UTF-8.");
136+
+ "\u201D used. Documents must use UTF-8.");
137137
}
138138
if (encoding == null
139139
&& (heuristics == Heuristics.CHARDET || heuristics == Heuristics.ALL)) {
@@ -160,9 +160,9 @@ public HtmlInputStreamReader(InputStream inputStream,
160160
driver.setEncoding(Encoding.UTF8, Confidence.CERTAIN);
161161
}
162162
} else {
163-
warn("Legacy encoding \u201C"
163+
err("Legacy encoding \u201C"
164164
+ encoding.getCanonName()
165-
+ "\u201D used. Documents should use UTF-8.");
165+
+ "\u201D used. Documents must use UTF-8.");
166166
if (driver != null) {
167167
driver.setEncoding(Encoding.UTF16, Confidence.CERTAIN);
168168
}

0 commit comments

Comments
 (0)