I'm working with an HTML document I did not author. It contains the following:
<link rel="stylesheet" href="/static/oxygen-fontfacekit/stylesheet.css" charset="utf-8" />
Does specifying the charset in this way have any effect, or is the character set determined by the Content-Type response header?
The W3C says:
The idea is that the browser would be able to apply the right encoding to the document it retrieves if no encoding is specified for the document in any other way. The use of this attribute on an
a
orlink
element is currently deprecated by the HTML5 specification, so you should avoid using it on those elements.In addition, there are some things to consider before using this attribute. Firstly, it is not well supported by major browsers.Secondly, it is hard to ensure that the information is correct at any given time. The author of the document pointed to may well change the encoding of the document without you knowing. If the author still hasn't specified the encoding of their document, you will now be asking the browser to apply an incorrect encoding. And thirdly, it shouldn't be necessary anyway if people follow the guidelines... and mark up their documents properly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With