Error: The character encoding was not declared

I use minify for both css and js via the W3 Total Cache plugin.

In W3C validator I get:

*Error: The character encoding was not declared. Proceeding using windows-1252.

Error: Changing character encoding utf-8 and reparsing.

Fatal Error: Changing encoding at this point would need non-streamable behavior.*

This is what I have in the source code:

And my head.php looks like this

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link rel="stylesheet" type="text/css" href="" media="all" />

<script async type="text/javascript" src=""></script>
</head>

For some reason, the W3 Total Cache inserts the minified files above the character encoding. How do I place them after the character encoding is set? Thanks!


ANSWERS:


I know this post is old, but I had the same problem today and I was searching around for the answer till I found it myself. So if it can help someone...

I had the following errors when trying to validate my JSHangman.html page on the w3c html validator:

Error: The character encoding was not declared. Proceeding using windows-1252.

Error: A charset attribute on a meta element found after the first 1024 bytes.

At line 39, column 25

 charset="utf-8" />↩  </head>↩

Error: Changing character encoding utf-8 and reparsing.

From line 39, column 5; to line 39, column 28

itle>↩    <meta charset="utf-8" />↩  </h

Fatal Error: Changing encoding at this point would need non-streamable behavior.

At line 39, column 28

arset="utf-8" />↩  </head>↩  <

In fact, the answer was in the second error line:

Error: A charset attribute on a meta element found after the first 1024 bytes.

I had a big comment (something like 20 lines) between my <!DOCTYPE> tag and my <\html> tag and that was the issue. My problem was solved as soon as I deleted it.



 MORE:


 ? Proper Charset to work with Vietnamese Characters (that isn't Unicode) in PHP
 ? Writing and reading JSON with Python, how to decode/encode special characters?
 ? Writing and reading JSON with Python, how to decode/encode special characters?
 ? Writing and reading JSON with Python, how to decode/encode special characters?
 ? Writing and reading JSON with Python, how to decode/encode special characters?
 ? Unicode in python
 ? Character encoding in python to replace 'u2019' with '
 ? Yet another JSON/encoding error in Python
 ? Playing around with Devanagari characters
 ? Want to display data in Indian Regional language(Telugu,Hindi,Tamil and Malayalam) from RSSFeed in android?