WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#12390 closed defect (bug) (wontfix)

UTF-8 theme files lead to double Byte Order Mark

Reported by: varsity Owned by: hakre
Milestone: Priority: low
Severity: normal Version: 2.9.2
Component: Charset Keywords: close
Focuses: Cc:

Description

At some point I switched my theme's header.php to UTF-8. This has led to WordPress generating pages with the Unicode Byte Order Mark (hex: EF BB BF / ASCII: ) repeated twice: one instance added by the code, correctly, and the other inserted when parsing the header file.

This has come to light thanks to the current Steam beta (http://store.steampowered.com/uiupdate/), in which WebKit plain refuses to load application/xhtml+xml pages with two BOMs.

I can't explain why Chrome and Safari and other browsers don't falter in the same way, but it seems unwise to assume that it's because this "double BOM" behaviour is acceptable. It should be fixed to prevent future problems.

Change History (5)

comment:1 Denis-de-Bernardy4 years ago

  • Keywords close added
  • Milestone changed from Unassigned to Future Release

See #6795 - closed as wontfix

comment:2 miqrogroove4 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

I agree with Denis. Don't put BOMs in your PHP files. Problem solved.

comment:3 varsity4 years ago

Assuming you know what a BOM is. I wouldn't argue with "it's too obscure and harmless", but "users should know better" doesn't cut the mustard. Unlike writing a plugin, switching a theme file to UTF8 so you can use non-ASCII characters is not an overtly technical operation.

comment:4 dd324 years ago

This has come up a few times..

Put a BOM character into your files and you end up with that problem, Its as simple as that.

Even if you dont do it deliberately, what is WordPress supposed to do? Filter the output of all your pages and ensure that its not present?

There is unfortunately, not much that can be done that wont harm performance for others. The benefit is slim.

comment:5 dd324 years ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.