Issue library · 4 technical html checks

Language, charset, and document declaration issues

Give browsers, crawlers, and assistive technology a predictable document language, encoding, and HTML foundation.

Direct answer

Declare HTML5, UTF-8, and a valid page language in the rendered document. These basics reduce ambiguity for rendering, text processing, accessibility, and international interpretation.

Why this area matters

Missing or invalid document declarations can cause inconsistent rendering and make language-dependent processing less reliable.

Repair workflow

  1. Start with the HTML5 doctype.
  2. Declare UTF-8 early in the head.
  3. Set a valid BCP 47 language on html.
  4. Verify the server sends compatible content-type information.

Verification checklist

  • Inspect the final rendered document.
  • Check response Content-Type separately.
  • Test language output with accessibility tools.

Exact findings explained

Page language is missing

The html element has no lang value.

What to do

Set the main content language using a valid BCP 47 tag.

How to verify

Inspect the html element and confirm assistive technology announces the correct language.

Page language tag is invalid

The lang value does not match the expected language-tag format.

What to do

Replace it with a valid language or language-region value.

How to verify

Validate the code and test pronunciation with assistive technology.

Character encoding is unclear

No character encoding was captured.

What to do

Declare UTF-8 early in the head and align the HTTP header.

How to verify

Inspect rendered text for corruption and verify Content-Type.

HTML doctype is missing

The document has no captured HTML doctype and may enter quirks mode.

What to do

Place <!doctype html> before the root html element.

How to verify

Check document.compatMode and confirm standards mode.