Skip to content

Commit 7fa4d80

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 514edc9 commit 7fa4d80

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
@@ -384,7 +384,7 @@ public boolean internalEncodingDeclaration(String internalCharset)
384384
+ "\u201D disagrees with the actual encoding of the document (\u201C"
385385
+ characterEncoding.getCanonName() + "\u201D).");
386386
} else {
387-
Encoding newEnc = whineAboutEncodingAndReturnActual(
387+
Encoding newEnc = whineAboutEncodingAndReturnCanonical(
388388
internalCharset, cs);
389389
tokenizer.errTreeBuilder("Changing character encoding \u201C"
390390
+ internalCharset + "\u201D and reparsing.");
@@ -452,7 +452,7 @@ protected Encoding encodingFromExternalDeclaration(String encoding)
452452
|| "utf-32".equals(cs.getCanonName())) {
453453
swallowBom = false;
454454
}
455-
return whineAboutEncodingAndReturnActual(encoding, cs);
455+
return whineAboutEncodingAndReturnCanonical(encoding, cs);
456456
} catch (UnsupportedCharsetException e) {
457457
tokenizer.err("Unsupported character encoding name: \u201C" + encoding
458458
+ "\u201D. Will sniff.");
@@ -467,7 +467,7 @@ protected Encoding encodingFromExternalDeclaration(String encoding)
467467
* @return
468468
* @throws SAXException
469469
*/
470-
protected Encoding whineAboutEncodingAndReturnActual(String encoding,
470+
protected Encoding whineAboutEncodingAndReturnCanonical(String encoding,
471471
Encoding cs) throws SAXException {
472472
String canonName = cs.getCanonName();
473473
if (!canonName.equals(encoding)) {

0 commit comments

Comments
 (0)