NeovaNền tảng SEO chuyên sâu

Thiếu khai báo charset

Trong Neova Chạy ngay từ lần crawl: không cần thiết lập gì.

Quy tắc được rà soát lần cuối ngày 17 tháng 10 năm 2026 · Hướng dẫn cập nhật ngày 7 tháng 7 năm 2026

Chuẩn HTML yêu cầu khai báo bảng mã ký tự, và Lighthouse áp dụng đúng ba điều kiện đó. Thiếu nó, trình duyệt và crawler có thể hiển thị văn bản sai ký tự.

Bạn có thể làm gì

Thêm <meta charset="utf-8"> ở đầu head, trong 1024 byte đầu tiên, hoặc đặt charset trong header Content-Type.

Vì sao Neova đánh dấu

  • Không khai báo encoding, trình duyệt và crawler có thể đoán sai và hiện chữ có dấu, ký hiệu thành ký tự rác.
  • Tiêu chuẩn HTML yêu cầu khai báo encoding nằm trong 1024 byte đầu của tài liệu.
  • Lighthouse đánh trượt trang thiếu khai báo charset hoặc khai báo quá muộn.

Nguồn

Hướng dẫn đầy đủ

Phần này tạm thời còn bằng tiếng Anh.

This check fires when a page ships no character encoding declaration — no <meta charset> in the head and no charset in the Content-Type HTTP header. Without it, the browser and Googlebot have to guess the encoding, and when they guess wrong you get mojibake: curly quotes turn into ’, accented names break, emoji become question marks. Garbled text hurts readability, can distort how Google parses your content, and looks broken to anyone who lands on the page.

Note the near-duplicate slug on this site, Missing Charset — same underlying issue. If both surface in your audit, treat them as one fix.

What Breaks When Encoding Is Undeclared

Modern browsers default to UTF-8 in many cases, but "many" isn't "all," and you don't control every client or proxy in the chain. When no charset is declared, the parser falls back to sniffing bytes or applying a locale-dependent default like Windows-1252. Any multi-byte character — an em dash, a smart quote, a é or an ü — then renders as garbage.

Here's a page with no declaration anywhere. The content is UTF-8 on disk, but nothing tells the client that:

<!DOCTYPE html>
<html>
<head>
  <title>Café Menu — Crème Brûlée</title>
  <!-- no charset declared, no header charset either -->
</head>
<body>
  <h1>Crème Brûlée — £7.50</h1>
</body>

On a client that defaults to Windows-1252, the heading can render as Crème Brûlée — £7.50. Ugly, and Google may index the mangled version.

The Fix: Declare UTF-8, First Thing in the Head

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">  <!-- must be within the first 1024 bytes -->
  <title>Café Menu — Crème Brûlée</title>
</head>

The <meta charset> must appear inside the first 1024 bytes of the document, which in practice means it should be the very first thing in the head, before the <title>. Belt and braces: also send it in the header — Content-Type: text/html; charset=utf-8. The HTTP header wins over the meta tag when both are present, so make sure they agree.

Charset Declaration Methods, Ranked

Method Example Precedence Notes
HTTP header Content-Type: text/html; charset=utf-8 Highest Overrides the meta tag; set at the server
Meta charset (HTML5) <meta charset="utf-8"> Used if no header Must be in first 1024 bytes
Legacy meta <meta http-equiv="Content-Type" ...> Works but verbose The short form is preferred
BOM (byte-order mark) Invisible UTF-8 BOM Fallback signal Can cause its own issues; avoid relying on it
Nothing declared — Guesswork Mojibake risk

How to Detect It

  1. Screaming Frog. After a crawl, this shows in the page-level data — check the Content tab and the response headers for each URL. Frog surfaces the declared encoding; pages with none flagged, or a mismatch between the header charset and the meta charset, are your targets. Use Bulk Export to pull the full list.
  2. View Source. Ctrl+U and search for charset. If there's no match, or the tag sits deep in the head after a lot of other markup (pushing it past the 1024-byte window), flag it. Then open DevTools → Network, click the document request, and read the Content-Type response header to see if the server declares one.
  3. Google Search Console. URL Inspection → View crawled page. If the rendered HTML shows garbled characters where accents or symbols should be, Google is parsing the wrong encoding. Compare against how the page looks in your own browser with the encoding forced to UTF-8.

How to Fix It

  1. Set the server header to text/html; charset=utf-8 for all HTML responses. This is the most reliable single fix because it wins precedence.
  2. Add <meta charset="utf-8"> as the first element inside <head>, before the title, so it's inside the 1024-byte window even if the header is missing.
  3. Make sure the file is actually saved as UTF-8. Declaring UTF-8 while the bytes are Windows-1252 just relocates the problem. Check your editor's encoding and your database/connection collation.
  4. Keep header and meta in agreement. A header saying iso-8859-1 with a meta saying utf-8 will render as the header says — and probably wrong.
  5. Re-crawl and spot-check pages with accented content, currency symbols, and smart quotes to confirm the garbling is gone.

FAQ

Won't Browsers Just Default to UTF-8 Now?

Many will, but not universally, and not through every proxy or CDN. Relying on defaults means gambling on the client. Declare it and stop guessing.

Does a Missing Charset Actually Hurt Rankings?

Not directly as a ranking factor, but garbled text degrades how Google reads your content and tanks the experience for users, which shows up in engagement. Mangled titles and headings can also look broken in the SERP.

Header Charset or Meta Charset — Which Should I Use?

Use both, and make them match. The header takes precedence, so if you can only fix one, fix the header. The meta tag is your safety net when the header is absent.

Where Exactly Does the Meta Charset Need to Go?

Inside the first 1024 bytes of the document, which means the very top of the head, before the title and any other metadata. If you bury it, the browser may have already started sniffing.

Yes — if the head is malformed or closes early, your charset tag can end up outside it and get ignored. Validate the head; see Missing Head Tag. For encoding on other document types, the HTTP header optimization guide covers server-side declarations.

Tìm lỗi này trên trang của bạn

Neova chạy mục kiểm tra này và mọi mục khác trong mỗi lần crawl, rồi viết cách sửa thành ticket cho nhóm của bạn.

  • Ứng dụng máy tính cho Mac, Windows và Linux
  • Tất cả 696 mục kiểm tra, mỗi mục kèm nguồn
  • Search Console và Analytics 4, kết nối chỉ đọc
  • Ticket sang Jira, Linear và Asana

Tải Neova Gói Desktop Free, hoặc dùng thử Solo miễn phí 14 ngày, không cần thẻ.

Tất cả mục kiểm tra Nội dung · Hướng dẫn · Thư viện mục kiểm tra

Do Neova Labs biên soạn · Quay lại Thư viện mục kiểm tra