// Since UTF-32 is not supported:
// * HTML resources will use the parent encoding (UTF-8)
// * XML resources will default to UTF-8
// ... except for the UTF-32LE-with-BOM case, where the UTF-32
// BOM will be mistaken for a UTF-16LE BOM (FF FE 00 00), in which
// case it will be interpreted as UTF-16LE.
samples.forEach(expected => async_test(t => {
const iframe = document.createElement('iframe'); iframe.src = expected.file; iframe.onload = t.step_func_done(() => {
const doc = iframe.contentDocument;
assert_equals(doc.contentType, expected.contentType);
assert_equals(doc.characterSet, expected.characterSet);
// The following is a little quirky as non-well-formed XML isn't defined in sufficient detail to
// be able to use more precise assertions.
assert_true(
!('dataset' in doc.documentElement) ||
doc.documentElement.dataset['parsed'] !== 'yes', 'Should not have parsed as (X)HTML');
});
document.body.appendChild(iframe);
t.add_cleanup(() => iframe.remove());
}, `Expect ${expected.file} to parse as ${expected.characterSet}`));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.