Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

HTML5 charset

#3655

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...

Reported by Dan Croak · January 5th, 2010 @ 03:29 AM

State: committed
Milestone: 3.0.2
Assigned to: josh josh
Importance: Low

Activity

  1. Marshall Huss
  2. Tristan Dunn
  3. Mark Turner
  4. Jeremy Kemper
    Jeremy Kemper
    • 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...

    January 5th, 2010 @ 07:30 AM

  5. josh
    josh

    Do we even need that line at all? We set the Content-Type header correctly.

    Content-Type: text/html; charset=utf-8
    

    January 5th, 2010 @ 02:30 PM

  6. Dan Croak
    Dan Croak

    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.

    January 5th, 2010 @ 03:28 PM

  7. josh
  8. Jeremy Kemper
    Jeremy Kemper

    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.

    January 5th, 2010 @ 05:51 PM

  9. Dan Croak
    Dan Croak

    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.

    January 5th, 2010 @ 06:38 PM

  10. Dan Croak
  11. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to Low

    October 15th, 2010 @ 11:01 PM