A charset attribute on a meta element found after the first 512 bytes

Rule from html under compatibility category

What is a trooper!

we have submitted your edit to the community for review! We'll review and make it live on the site in the next few hours, the internet thanks you :).

Browse another section of the knowledge base



Suggest an edit

Cancel

This rule has no content... yet.

Add content to this rule

Or just browse to view rules that have content



 

In computing, a character encoding is used to represent a repertoire of characters by some kind of an encoding system.

Many exist such as:

  • ACSII
  • ANSI (Windows-1252)
  • ISO-8859-1
  • UTF-8 (Unicode)

Because ACSII and ANSI are so limited, UTF-8 is recommended for most scenarios users might encounter.

Meta tags allows setting the charset of a document using:

<meta charset="UTF-8">

This tag is expected to be found found at the top of the head section of the page. Thus refering to this rule as The First 512 Bytes.

How do I fix this ?

Fixing is a matter of making sure that the <meta charset="UTF-8"> tag is the first element of the <head> section.

So something like this:

<!DOCTYPE html> 
<html> 
  <head>
    <link rel="stylesheet" type="text/css" href="http://example.com/style.css" media="all" />
    <meta charset="UTF-8">

should be updated to the following:

<!DOCTYPE html> 
<html> 
  <head>
    <meta charset="UTF-8">
    <link rel="stylesheet" type="text/css" href="http://example.com/style.css" media="all" />

Resources

Browse another section of the knowledge base



Signup icon
Ready to see how well your site scores?

Passmarked works best when you have an account. It allows you to keep a dashboard with saved data of the sites you have run through the system, we’ll alert you about important updates and you get access to the Passmarked Slack forum.

Sign up to get started