Skip to content

Commit c536a4a

Browse files
Rename to whineAboutEncodingAndReturnCanonical()
This change renames the whineAboutEncodingAndReturnActual() method to whineAboutEncodingAndReturnCanonical() — in order to make more clear it’s reporting that the canonical name of the encoding is preferred over any particular label for that encoding.
1 parent 9d2d39d commit c536a4a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ public boolean internalEncodingDeclaration(String internalCharset)
367367
+ "\u201D disagrees with the actual encoding of the document (\u201C"
368368
+ characterEncoding.getCanonName() + "\u201D).");
369369
} else {
370-
Encoding newEnc = whineAboutEncodingAndReturnActual(
370+
Encoding newEnc = whineAboutEncodingAndReturnCanonical(
371371
internalCharset, cs);
372372
tokenizer.errTreeBuilder("Changing character encoding \u201C"
373373
+ internalCharset + "\u201D and reparsing.");
@@ -435,7 +435,7 @@ protected Encoding encodingFromExternalDeclaration(String encoding)
435435
|| "utf-32".equals(cs.getCanonName())) {
436436
swallowBom = false;
437437
}
438-
return whineAboutEncodingAndReturnActual(encoding, cs);
438+
return whineAboutEncodingAndReturnCanonical(encoding, cs);
439439
} catch (UnsupportedCharsetException e) {
440440
tokenizer.err("Unsupported character encoding name: \u201C" + encoding
441441
+ "\u201D. Will sniff.");
@@ -450,7 +450,7 @@ protected Encoding encodingFromExternalDeclaration(String encoding)
450450
* @return
451451
* @throws SAXException
452452
*/
453-
protected Encoding whineAboutEncodingAndReturnActual(String encoding,
453+
protected Encoding whineAboutEncodingAndReturnCanonical(String encoding,
454454
Encoding cs) throws SAXException {
455455
String canonName = cs.getCanonName();
456456
if (!canonName.equals(encoding)) {

0 commit comments

Comments
 (0)