SEOscanner.app

Rule · Document head and metadata

One UTF-8 character encoding declaration

SEO-HEAD-02C3 Standard· w2

Class
C3 Standard
Weight
2
Severity on fail
minor
Applies to
the HTML Standard

Scope and evidence

Evaluated on page (P). The book marks this requirement STANDARD.

Fail conditions

Each condition has a stable code and a reason template. The evaluator fills the placeholders from observed values only; no sentence in a report is generated.

  • multiple_charset_meta

    {url} has {n} <meta charset> elements. The HTML Standard allows no more than one meta element with a charset attribute per document.

  • not_utf8

    {url} declares or uses the encoding “{label}”. The HTML Standard notes that the Encoding Standard requires UTF-8.

  • declaration_too_late

    The character encoding declaration on {url} ends at byte {offset}. The HTML Standard requires it to be serialized completely within the first 1024 bytes.

The documented fix

Emit <meta charset="utf-8"> as the first child of <head>, once, and serve Content-Type: text/html; charset=utf-8.

Sources, quoted

These are the passages the rule rests on, stored once in the knowledge base and emitted exactly as written. A citation marked for specific conditions appears only on findings with those codes.

  • “There must not be more than one meta element with a charset attribute per document.”

    [WHATWG-SEM] HTML Standard: 4.2 Document metadata (and 4.1 The document element) · Specifying the document's character encoding · last updated Living Standard

    https://html.spec.whatwg.org/multipage/semantics.html
  • “The Encoding standard requires use of the UTF-8 character encoding and requires use of the "utf-8" encoding label to identify it.”

    [WHATWG-SEM] HTML Standard: 4.2 Document metadata (and 4.1 The document element) · Specifying the document's character encoding · last updated Living Standard

    https://html.spec.whatwg.org/multipage/semantics.html
  • “The element containing the character encoding declaration must be serialized completely within the first 1024 bytes of the document.”

    [WHATWG-SEM] HTML Standard: 4.2 Document metadata (and 4.1 The document element) · Specifying the document's character encoding · last updated Living Standard

    https://html.spec.whatwg.org/multipage/semantics.html