Returns the character encoding of the current document.
var string = document.characterSet;
<button onclick="alert(document.characterSet);">Show character set</button> // returns document's character set, such as "ISO-8859-1" or "UTF-8"
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).
Document Tags and Contributors
Last updated by: Sheppy,