document.characterSet

概要

文書の文字エンコーディングを表す文字列を返します。

構文

document.characterSet

例

string = document.characterSet;
<button onclick="alert(document.characterSet);">Show character set</button>
<!-- "ISO-8859-1" や "UTF-8" など、文書の文字セットが表示されます -->

注記

文字エンコーディングは文書のレンダリングに使用される文字セットです。文字エンコーディングは上書き可能である為、文書に指定したエンコーディングと異なるものが返る場合があります。

非標準の関連プロパティの document.charset 及び document.defaultCharset は Gecko ではサポートされていません。

仕様書

Document Tags and Contributors

Contributors to this page: ethertank
最終更新者: ethertank,