This page was translated from English by the community. Learn more and join the MDN Web Docs community.

View in English Always switch to English

Document.characterSet

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2015년 7월⁩.

Document.characterSet 읽기 전용 속성은 현재 문서가 렌더링에 사용하는 문자 인코딩을 반환합니다.

참고: Document.charsetDocument.inputEncoding 속성은 Document.characterSet의 이전 별칭입니다. 더 이상 사용지 마세요.

예제

html
<button onclick="console.log(document.characterSet);">
  콘솔에 인코딩 출력
</button>
<!-- "ISO-8859-1"이나 "UTF-8" 등, 문서의 캐릭터 셋 기록 -->

명세서

Specification
DOM
# ref-for-dom-document-characterset①

브라우저 호환성