How to get document default character set
Default character set
document.defaultCharset
gets the default character encoding.
The return type is string
.
Example
<!DOCTYPE HTML>
<html>
<body>
<script>
document.writeln(document.defaultCharset);
</script>
</body>
</html><!-- www . ja v a 2 s. c o m-->