This project is archived and is in readonly mode.
HTML5 charset
Reported by Dan Croak | January 5th, 2010 @ 03:29 AM | in 3.0.2
Rails error pages, public/index.html, and app/layout all use HTML5 now. The HTML5 specification has a shorter way of setting character encoding.
http://dev.w3.org/html5/html4-differences/#character-encoding
That's all this patch does, continuing on this commit by Josh Peek:
http://github.com/rails/rails/commit/01d92021e69f54def1ec8103b2b99f...
Attached a diff per the Lighthouse instructions. Can be viewed with nice coloration at Github:
http://github.com/dancroak/rails/commit/62c7964c7a60091cfd8250c701b...
http://github.com/dancroak/rails/commit/aff1dbc33fe559b7a3e95342eee...
I didn't change any tests as they look like they simply test that the layout file is created:
http://github.com/dancroak/rails/blob/3f28e0bda6386ed25d07182dd39b8...
Comments and changes to this ticket
-
Jeremy Kemper January 5th, 2010 @ 07:30 AM
- Assigned user set to josh
- State changed from new to open
- Milestone cleared.
<meta charset=utf-8>
is a bit shorter, and a BOM is shorter still... -
josh January 5th, 2010 @ 02:30 PM
Do we even need that line at all? We set the Content-Type header correctly.
Content-Type: text/html; charset=utf-8
-
Dan Croak January 5th, 2010 @ 03:28 PM
Josh,
Yes, if Rails is correctly setting the Content-Type header, then those lines are unnecessary in HTML5.
Attached a self-contained, one commit patch that removes those lines.
-
josh January 5th, 2010 @ 04:15 PM
- State changed from open to committed
-
Jeremy Kemper January 5th, 2010 @ 05:51 PM
Rails doesn't set the header when the public files are served by apache/nginx/httpd directly, so they have metas in case the server isn't configured to use UTF-8 default. Using a BOM would work around that as well.
-
Dan Croak January 5th, 2010 @ 06:38 PM
Jeremy,
I don't really understand the BOM but I see what you're saying about the public files.
If you want it, I attached another patch that brings back the short meta charset tags for just the public files (the erb layout remains without any meta tag or BOM).
Thanks for sweating the details, guy. I realize this was very low on the list of priorities.
-
Jeremy Kemper October 15th, 2010 @ 11:01 PM
- Milestone set to 3.0.2
- Importance changed from to Low
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>