Skip to content

Commit ba04073

Browse files
committed
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
1 parent e7facb3 commit ba04073

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

railties/lib/rails/generators/rails/app/templates/app/views/layouts/application.html.erb.tt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="utf-8">
45
<title><%= camelized %></title>
56
<%- if options[:skip_javascript] -%>
67
<%%= stylesheet_link_tag "application", media: "all" %>

0 commit comments

Comments
 (0)