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.
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
- http://www.w3.org/TR/DOM-Level-3-Cor...ment3-encoding
- This has been removed from DOM Core Level 4WD
Browser compatibility
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
xmlEncoding | Chrome Full support 1 | Edge Full support 12 | Firefox No support No | IE ? | Opera ? | Safari ? | WebView Android Full support Yes | Chrome Android Full support Yes | Firefox Android No support No | Opera Android ? | Safari iOS ? | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- No support
- No support
- Compatibility unknown
- Compatibility unknown
- Non-standard. Expect poor cross-browser support.
- Non-standard. Expect poor cross-browser support.
- Deprecated. Not for use in new websites.
- Deprecated. Not for use in new websites.