Prevent UTF-7 Cross Scripting Attacks

The `<meta charset>` attribute sets the character encoding of an HTML document. It is extremely important that you explicitly declare the encoding of every HTML document; failing to do so will cause browsers to guess the encoding, which can lead to cross-site scripting attacks if they guess incorrectly.

In order for all browsers to recognize a `<meta charset>` declaration, it must be:

- Within the `<head>` element,
- Before any elements that contain text, such as the `<title>` element, AND
- Within the first 512 bytes of your document, including DOCTYPE and whitespace.
- This patch simply places the `<meta charset>` tag above the `<title>` tag, instead of below it

Source: https://code.google.com/p/doctype-mirror/wiki/MetaCharsetAttribute

![ ](http://s2.developerslife.ru/public/images/gifs/14912644-8e1e-499f-b4d0-988bab40a580.gif)