diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2013-09-10 14:37:39 -0700 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2013-09-10 14:37:39 -0700 |
commit | ba0407337e93c4ef55cef3472143f62e8a984a64 (patch) | |
tree | c8eb37c9c85cd237e598bc370e875fb511a4f235 | |
parent | e7facb35eb67836d446283bcb7d15d665b1bb668 (diff) | |
download | rails-ba0407337e93c4ef55cef3472143f62e8a984a64.tar.gz rails-ba0407337e93c4ef55cef3472143f62e8a984a64.tar.bz2 rails-ba0407337e93c4ef55cef3472143f62e8a984a64.zip |
Add meta tag with charset information to application layout.
Previously, our default HTML would validate properly, but would generate
a warning: it doesn't declare a character encoding.
According to [the spec][encoding-spec], if you don't specify an
encoding, a 7 step algorithm happens, with a toooon of sub-steps. Or, we
could just actually specify it.
Since everything else in Rails assumes UTF-8, we should make sure pages
are served with that encoding too. This meta tag is the simplest way to
accomplish this.
More resources:
* http://blog.whatwg.org/the-road-to-html-5-character-encoding
* http://www.w3.org/International/tutorials/tutorial-char-enc/
* http://validator.w3.org/
[encoding-spec]: http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#determining-the-character-encoding
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt b/railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt index c3d1578818..63783d7981 100644 --- a/railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt +++ b/railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt @@ -1,6 +1,7 @@ <!DOCTYPE html> <html> <head> + <meta charset="utf-8"> <title><%= camelized %></title> <%- if options[:skip_javascript] -%> <%%= stylesheet_link_tag "application", media: "all" %> |