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

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

📋 Pull Request Information

Original PR: https://github.com/php/web-doc-editor/pull/2
Author: @DaveRandom
Created: 9/18/2013
Status: Merged
Merged: 1/22/2014
Merged by: @php-pulls

Base: masterHead: documentNotUTF8-improvements


📝 Commits (1)

  • de3eaf1 Improve documentNotUTF8 check in ToolsError for HTML support

📊 Changes

1 file changed (+11 additions, -3 deletions)

View changed files

📝 php/ToolsError.php (+11 -3)

📄 Description

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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/php/web-doc-editor/pull/2 **Author:** [@DaveRandom](https://github.com/DaveRandom) **Created:** 9/18/2013 **Status:** ✅ Merged **Merged:** 1/22/2014 **Merged by:** [@php-pulls](https://github.com/php-pulls) **Base:** `master` ← **Head:** `documentNotUTF8-improvements` --- ### 📝 Commits (1) - [`de3eaf1`](https://github.com/php/web-doc-editor/commit/de3eaf1dad257195eb83b892f640b2aaf3fd4afa) Improve documentNotUTF8 check in ToolsError for HTML support ### 📊 Changes **1 file changed** (+11 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `php/ToolsError.php` (+11 -3) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
admin added the pull-request label 2026-01-24 11:41:13 +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#5