Check the character encoding of a given page in Chrome
Character encoding of an HTML document is determined by looking at various things (encoding in Content-Type
header, meta
elements, BOMs in data, etc.)
In Chrome (56), is there a way to view the ultimate character encoding that it determined a given page was using?
I've been poking around in the developer tools but nothing is popping out at me. I did find that you can view the Content-Type
headers in the Network tab but this doesn't cover the case where the encoding isn't specified there.
In the Chrome console:
document.characterSet
This is the encoding used to display the page, per MDN:
The
Document.characterSet
read-only property returns the character encoding of the current document. The character encoding is the character set used for rendering the document, which may be different from the encoding specified by the page. (The user can override the encoding.).