On 10/24/19 11:47 AM, Wim Lewis wrote: > On Wed, Oct 23, 2019 at 08:14:15PM +0200, Niels Möller wrote: >> inside <head>...</head>, which is supposed to override whatever the >> actual http headers say. And that seems to work. > > That was my understanding as well but I had almost this problem a week > or so ago and found that (in modern browsers at least) the HTTP header > takes precedence. Web documentation currently[1] says that the meta tag > only overrides the charset if the header does not have a charset > parameter at all. > > [1] The HTML Living Standard is an utter mess of broken behavior, and I > feel bad using it as a reference, but it seems unambiguous that the > presence of a charset parameter in the HTTP header prevents > re-scanning the document if a meta tag specifies a different > charset: > > https://html.spec.whatwg.org/multipage/parsing.html#determining-the-character-encoding >
Thanks, Wim. Niels, considering this, you could perhaps save the HTML document as iso-8859-1 and change the meta tag to contain "charset=iso-8859-1". That works as long as you don't use characters outside that charset. Best solution would be to contact the server admin to remove that charset info from the Content-Type header. It's a (legacy) bug anyways. Regards, Tim
signature.asc
Description: OpenPGP digital signature
_______________________________________________ nettle-bugs mailing list [email protected] http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs
