Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify the relationship between the Text Declaration and document.characterSet #34

Closed
DavidBruant opened this issue Jan 5, 2018 · 1 comment
Assignees

Comments

@DavidBruant
Copy link

const inXMLStr = `<?xml version="1.0" encoding="ISO-8859-1"?> <x/>`
  
const doc = (new DOMParser()).parseFromString(inXMLStr, 'text/xml')
  
console.log(doc.characterSet)

Both Firefox and Chrome say 'UTF-8' ignoring completely the encoding="ISO-8859-1". Totally fine behavior as far as I'm concerned, I haven't tested in other browsers

@domenic
Copy link
Collaborator

domenic commented Jan 4, 2020

I've added a note about this to whatwg/html#5190.

@domenic domenic self-assigned this Jan 4, 2020
domenic added a commit to whatwg/html that referenced this issue Jan 28, 2020
This moves the DOMParser class from https://w3c.github.io/DOM-Parsing/
into HTML, per various offline discussions. Along the way, it improves
the spec in several minor ways and a couple notable ways:

* It precisely defines the URL of the resulting document, in a way that
  matches the majority of browsers. As such, this closes
  w3c/DOM-Parsing#46.
* It more clearly states how the parser error documents are created,
  namely that they also get their content type and URL set.

This also closes w3c/DOM-Parsing#51 and
w3c/DOM-Parsing#34 by adding explanatory
notes for points that confused people enough to file an issue.

Tests: web-platform-tests/wpt#21041
@domenic domenic closed this as completed Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants