The characterSet Document for JS returns document’s encoding.
document.characterSet
adoptNode
compatMode
contentType
createCDATASection
createComment
createDocumentFragment
createElement
createElementNS
createProcessingInstruction
createTextNode
doctype
Document
documentElement
documentURI
exitPictureInPicture
getElementsByClassName
getElementsByTagName
getElementsByTagNameNS
implementation
importNode
pictureInPictureEnabled
URL
write
writeln
Web Hypertext Application Technology Working Group (WHATWG)