HTML character encoding declaration not found

accidentally getting this problem appears in my firefox web console (this is the js tab)

Just appeared and could not connect it with any changes that I made.

Full error:

The page was reloaded, because the character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. The encoding declaration needs to be moved to be within the first 1024 bytes of the file. 

Or this one:

 The character encoding declaration of the HTML document was not found when prescanning the first 1024 bytes of the file. When viewed in a differently-configured browser, this page will reload automatically. The encoding declaration needs to be moved to be within the first 1024 bytes of the file. 

The problem points to this line:

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

Is this meta tag okay for me? Any help as I think it conflicts and causes problems with other things.

Craig

+7
source share
2 answers

Charset is a content type parameter, not a separate attribute:

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

Or if you want to use the HTML 5 style:

 <meta charset="utf-8"> 

You should also note the error message:

not found when pre-scanning the first 1024 bytes of the file

You may need to move the meta tag up in the document. Ideally, this should be the first tag inside the <head> .

+11
source

I had exactly the same problem, however this was because I had a bug report included for testing. They were deduced before the HTML that caused this error. I turned off the error message, and, of course, the character encoding was visible in the first 1024 bytes.

0
source

Source: https://habr.com/ru/post/972623/


All Articles