Repository navigation
Sniff XML encoding declarations - #30
Merged
Merged
Conversation
Implement HTML's UTF-16 byte signatures and XML-declaration fallback after meta scanning. Keep the meta prescan within 1024 bytes while allowing XML declarations to extend beyond that window, with the encoding label and closing quote required before the first `>`. Extend `xml: true` with WebKit-compatible declaration and UTF-16 signature sniffing, retaining BOM and transport-layer precedence. Follow WebKit pending resolution of whatwg/html#12968. In both modes, normalize UTF-16 declaration labels to UTF-8 and preserve x-user-defined. Ignore meta tags truncated by EOF or the prescan limit, which previously could supply an encoding despite their missing closing `>`. Fixes #22. Co-Authored-By: codex <codex@openai.com>
domenic
force-pushed
the
codex/xml-encoding-sniffing
branch
from
September 21, 2026 06:45
9eb8627 to
67f8869
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implement XML declaration and UTF-16 signature sniffing in both modes, and fix meta declarations truncated at EOF or the prescan limit incorrectly supplying an encoding.