Skip to content

Test your website now

Free, no card. We read only public pages.

Run free audit →

Browser compat · Low severity

Page Not Encoded in UTF-8: Align Actual Bytes and Declarations

Review non-UTF-8 declarations. Inspect bytes and headers, test conversion on a backup, and verify storage, forms and integrations before release.

Published · Updated

What the check tests

Check
compat.charset-utf8 - UTF-8 encoding
Passes when
The declared charset should be UTF-8; legacy encodings break on modern toolchains.
Scope
graded on every page crawled
Severity
Low
Fix effort
small - under an hour
Impact when fixed
low

In one paragraph

Page not encoded in UTF-8 means this check observed a markup charset declaration outside its accepted UTF-8 labels. It does not directly validate the response bytes or every decoding signal. Inspect storage, application connections, headers, and actual browser output before changing anything. Convert known legacy data carefully when appropriate, then align declarations. Renaming an encoding without converting mismatched bytes can corrupt readable content.

Why it matters

UTF-8 is the standard modern web choice and can represent Unicode text. It is not the only Unicode encoding: UTF-16 and others also exist. The practical reason to prefer a coherent UTF-8 pipeline is compatibility and maintainability, not the false claim that no other encoding represents Unicode.

A correctly labelled legacy page can still be readable, while a falsely labelled UTF-8 response can be broken. The actual processing chain includes stored data, template files, database connections, generated response bytes, and consumers of forms or exports.

Encoding and collation are also distinct database concerns. A migration can affect comparison, sorting, indexes, or capacity beyond a visible character change. Do not run an unreviewed production database alteration based solely on an informational markup warning.

How WebAuditOS evaluates this finding

The supplied rule reads recognised charset declarations from eligible parsed HTML, not the HTTP Content-Type header or raw-byte validity. Its accepted utf-8 or utf8 labels pass; other declared values warn at low severity; absent markup declarations or unavailable/error documents can be ungraded.

A header-only UTF-8 response can therefore be ungraded, and contradictory transport or byte-order information can produce a different actual decoding outcome. A metadata pass is not proof that stored or delivered text is correctly encoded.

How to fix it

  1. Inventory the actual file encodings, database character sets and connections, response headers, and downstream consumers. Confirm what the current bytes represent rather than guessing from one label.
  2. Back up and test on a copy before conversion. Select representative content including accented text, non-Latin scripts, symbols, and characters outside the basic multilingual plane.
  3. Convert only from a verified source encoding. A file-level illustration is:
iconv -f WINDOWS-1252 -t UTF-8 legacy.html > converted.html

This assumes the input really is Windows-1252 and writes a separate output. It is not a command to run blindly over an unknown mixed-encoding archive.

  1. For databases, follow version-specific supported migration guidance and test indexes, collations, constraints, storage limits, and application behaviour. Where relevant, distinguish full Unicode support such as MySQL utf8mb4 from legacy narrower configurations.
  2. Align application connections and generated output so correct storage is not re-encoded incorrectly on delivery. Do not assume changing a database setting alone fixes the whole pipeline.
  3. Emit coherent declarations for real UTF-8 bytes, for example an early meta charset=utf-8 and suitable HTML response header. Complete the meta declaration within the required early placement and avoid competing stale declarations.
  4. Test reading, writing, forms, search, exports, email, integrations, and old non-ASCII URLs. Some routes may need deliberate compatibility handling when byte-based URL representations change.
  5. Rescan declaration checks and verify actual round-trip text. Keep a reviewed rollback plan; the scanner's limited metadata comparison cannot certify a completed migration.

What the fix can break

Double conversion can persist mojibake rather than merely display it. Do not run repeated conversion guesses on the same data.

A new connection charset or collation can change application behaviour even when sample pages look correct. Test actual queries and data updates.

Do not assume UTF-8 migration is a ranking fix or an emergency on every readable legacy page. Prioritise real correctness and planned maintenance with an evidence-based conversion process.

Questions

Is declaring UTF-8 enough to convert legacy data?

No. The declaration must match actual bytes and the complete storage/output pipeline.

Is UTF-8 the only Unicode encoding?

No. It is the modern web standard choice, but alternatives such as UTF-16 also encode Unicode.

Does this check validate headers and actual bytes?

Not under the supplied scope. It is a markup declaration comparison and needs separate verification.

Review charset presence, language consistency, and the website audit checklist.

In the report

Test this on your own site

Every scan runs compat.charset-utf8 on every page it crawls, on every plan. The finding carries this id, so a line in a report can be matched to the explanation above - and the free scan needs no account.