# Why no \<meta charset="utf-8" /\> in application.html.erb?

**URL:** <https://www.ruby-forum.com/t/why-no-meta-charset-utf-8-in-application-html-erb/192401>\
**Category:** Rails\
**Created:** [July 29, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/why-no-meta-charset-utf-8-in-application-html-erb/192401 "2010-07-29T16:27:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![johnny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@johnny](https://www.ruby-forum.com/u/johnny)\
**Post date:** [July 29, 2010, 4:27pm UTC](https://www.ruby-forum.com/t/why-no-meta-charset-utf-8-in-application-html-erb/192401/1 "2010-07-29T16:27:18Z")

</div>

I’m reading “Dive into html5” and in  
[http://diveintohtml5.org/semantics.html#encoding](http://diveintohtml5.org/semantics.html#encoding)  
, it says every page should contain ,  
otherwise it’s subject to security vulnerabilities (http://  
[code.google.com/p/doctype/wiki/ArticleUtf7](http://code.google.com/p/doctype/wiki/ArticleUtf7)). I don’t see being generated in my application.html.erb (in  
rails3) Is there a reason behind this?

---

<div class="post-metadata">

**Author:** ![johnny](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ecb155/32.png) [@johnny](https://www.ruby-forum.com/u/johnny)\
**Post date:** [July 29, 2010, 4:33pm UTC](https://www.ruby-forum.com/t/why-no-meta-charset-utf-8-in-application-html-erb/192401/2 "2010-07-29T16:33:44Z")

</div>

On Jul 29, 10:08 am, johnny [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’m reading “Dive into html5” and inhttp://diveintohtml5.org/semantics.html#encoding  
> , it says every page should contain ,  
> otherwise it’s subject to security vulnerabilities (http://  
> [Google Code Archive - Long-term storage for Google Code Project Hosting.](http://code.google.com/p/doctype/wiki/ArticleUtf7)). I don’t see being generated in my application.html.erb (in  
> rails3) Is there a reason behind this?

because rails sets the content-type header (which, as the article you  
linked to notes, is the preferred mechanism for this)

Fred
