Make WordPress Core

Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#12390 closed defect (bug) (wontfix)

UTF-8 theme files lead to double Byte Order Mark

Reported by: varsity's profile varsity Owned by: hakre's profile 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)

#1 @Denis-de-Bernardy
15 years ago

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

See #6795 - closed as wontfix

#2 @miqrogroove
15 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.

#3 @varsity
15 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.

#4 @dd32
15 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.

#5 @dd32
15 years ago

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