Validator doesn't follow 'get an encoding' in WHATWG Encoding spec #104
Description
Activity
Thanks for reporting this. It's a known issue that the Java code related to this in the parser doesn't conform to the current spec requirements.
Sorry for bothering you with a duplicate.
But I couldn't find the references.
please direct me to some issues, commits, or discussions.
'toNameKey' is first introduced in the commit:
772755d734bc99e1e9134ce9c350accd40edcf06 (github) bddf3a7b108407f70445e6f6499d9b252c1869d4 (mozilla) Wed May 28 10:52:40 2008 +0000 More encoding name matching magic (b=199)But where is 'b=199' ?
Sorry for bothering you with a duplicate.
I didn't mean it was a duplicate. I think you're the first person who's taken time to report it. I just meant that the relevant existing code is known to not be up to date with the current spec.
But I couldn't find the references.
please direct me to some issues, commits, or discussions.'toNameKey' is first introduced in the commit:
772755d734bc99e1e9134ce9c350accd40edcf06 (github) bddf3a7b108407f70445e6f6499d9b252c1869d4 (mozilla) Wed May 28 10:52:40 2008 +0000 More encoding name matching magic (b=199)But where is 'b=199' ?
Here: https://bugzilla.validator.nu/show_bug.cgi?id=199
Thanks for the clarification and the link.
'<meta charset="iso-8859- 2">'
or
'<meta charset="iso-8859-%2">'
returns
'Error Internal encoding declaration [...] disagrees with the actual encoding of the document (utf-8).'
While invald encoding name e.g '<meta charset=iso-8859-2a>'
returns
'Error: Internal encoding declaration named an unsupported chararacter encoding iso-8859-2a.'
From the spec, both cases are invalid encoding labels.
https://encoding.spec.whatwg.org/#names-and-labels
It seems
'toNameKey' in validator.htmlparser.io.Encoding
is just skipping invalid characters.
I'm not certain 'forName' in validator.encoding.Encoding
is related or not.