This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

defaultCharset

Summary

Gets the default character set from the current regional language settings.

Property of dom/Documentdom/Document

Syntax

Note: This property is read-only.

var defaultCharacterSet = document.defaultCharset;

Return Value

Returns an object of type StringString

The name of the default character set of the user.

Examples

//displays the document's default character encoding string
function showDefCharSet() {
    alert(document.defaultCharset);
}

Notes

The value depends on the current regional language settings. For typical settings in North America, the value is windows-1252.

Attributions