Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Document.xmlEncoding

我们的志愿者还没有将这篇文章翻译为 中文 (简体)加入我们帮助完成翻译!

Obsolete since Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0 / SeaMonkey 2.7)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.

Returns the encoding as determined by the XML declaration. Should be null if unspecified or unknown.

Warning: Do not use this attribute; it has been removed from the DOM Level 4 specification and is no longer supported in Gecko 10.0 (Firefox 10.0 / Thunderbird 10.0 / SeaMonkey 2.7).

If the XML Declaration states:

<?xml version="1.0" encoding="UTF-16"?>

...the result should be "UTF-16".

However, Firefox 3.0 includes information on endianness (e.g., UTF-16BE for big endian encoding), and while this extra information is removed as of Firefox 3.1b3, Firefox 3.1b3 is still consulting the file's encoding, rather than the XML Declaration as the spec defines it ("An attribute specifying, as part of the XML declaration, the encoding of this document.").

 

Specification

文档标签和贡献者

 此页面的贡献者: teoli, nairakhil13, Sheppy, Jürgen Jeka, Brettz9
 最后编辑者: teoli,