[PR #2] Improve documentNotUTF8 check in ToolsError for HTML support #7

Closed
opened 2026-01-24 11:41:13 +01:00 by admin · 0 comments
Owner

Original Pull Request: https://github.com/php/web-doc-editor/pull/2

State: closed
Merged: Yes


Improve documentNotUTF8 check to allow character set declarations in HTML documents:

  • Considers <meta http-equiv="content-type" content="text/html; charset=UTF-8"> to be a valid charset declaration
  • Considers <meta charset="UTF-8"> to be a valid charset declaration
  • Permits the encoding attribute of the relevant tag to appear anywhere within the tag (currently in the <?xml variant it must be the last attribute)
  • Permits the HTML variants to specify UTF8 as well as UTF-8 (all browsers forgive this mistake and understand it). The XML variant remains strict on this point.
**Original Pull Request:** https://github.com/php/web-doc-editor/pull/2 **State:** closed **Merged:** Yes --- Improve documentNotUTF8 check to allow <meta> character set declarations in HTML documents: - Considers `<meta http-equiv="content-type" content="text/html; charset=UTF-8">` to be a valid charset declaration - Considers `<meta charset="UTF-8">` to be a valid charset declaration - Permits the encoding attribute of the relevant tag to appear anywhere within the tag (currently in the `<?xml` variant it must be the last attribute) - Permits the HTML variants to specify `UTF8` as well as `UTF-8` (all browsers forgive this mistake and understand it). The XML variant remains strict on this point.
admin added the pull-request label 2026-01-24 11:41:13 +01:00
admin closed this issue 2026-01-24 11:41:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: php/web-doc-editor#7