# Language and encoding

Declared language and charset, so text is interpreted correctly.

**[Content](/docs/content)** · checked on every URL · 5 checks that can fail it

An undeclared or late charset makes an agent guess, and a wrong guess corrupts every non-ASCII character it reads. A malformed `lang` tag is a smaller problem but the same kind: the declaration is there and cannot be used.

## Adoption

**Web baseline** (L4)

Standard equipment on the web. Its absence is the exception rather than its presence. Direction of travel: ► flat, as of 2026-07-28.

BCP 47 and UTF-8 are near-universal; UTF-8 is on roughly 98% of pages (W3Techs).

## What we check

Absence is never a finding: every check below runs only once `langEncodingPresent` is true, so a site that has not
adopted this is not assessed on it and appears in no report.

| Check | Kind | Raises | On whose authority |
|---|---|---|---|
| `charsetMissing` | high severity | conformance, usability | specification (WHATWG HTML (Living Standard, 2026-07-28)) |
| `langMissing` | medium severity | usability | specification (WHATWG HTML (Living Standard, 2026-07-28)) |
| `langInvalidBcp47` | medium severity | usability | Lumar readiness profile |
| `charsetNonUtf8` | medium severity | usability | specification (WHATWG Encoding + HTML (Living Standard, 2026-07-28)) |
| `charsetLate` | medium severity | conformance, usability | specification (WHATWG HTML (Living Standard, 2026-07-28)) |

## Examples

These are the fixtures the test suite runs through the real collector, not snippets written for a document.

- Correct: `test/e2e/test-pages/content/correct.html`
- Present but wrong: `test/e2e/test-pages/content/issues.html`

## Specifications

| Document | Revision | Kind |
|---|---|---|
| [BCP 47 — Tags for Identifying Languages](https://www.rfc-editor.org/info/bcp47) | BCP 47 | specification |
| [WHATWG HTML — the lang attribute](https://html.spec.whatwg.org/multipage/dom.html#the-lang-and-xml:lang-attributes) | Living Standard | specification |
| [WHATWG Encoding Standard](https://encoding.spec.whatwg.org/) | Living Standard | specification |
| [WHATWG HTML — meta charset (within the first 1024 bytes)](https://html.spec.whatwg.org/multipage/semantics.html#charset) | Living Standard | specification |

Last re-read against the published documents: 2026-08-12.
