Chuyển đến nội dung
Skillpedia
Website và giao diện (frontend)75k · #2771

charset

Skill này làm gì

Skill này kiểm tra các trang HTML có khai báo bảng mã ký tự gần đầu tài liệu hay không. Skill dành cho lập trình viên muốn văn bản bằng mọi ngôn ngữ hiển thị đúng.

Khi nào nên dùng

  • ✓Khi trang hiển thị ký tự bị lỗi như dấu bị vỡ hoặc ký hiệu sai.
  • ✓Khi bạn tạo một template HTML mới.
  • ✓Khi bạn rà soát phần head của trang để kiểm tra thiết lập đúng.

Liên kết skill

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/charset/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/charset/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Hãy kiểm tra xem các template trang của tôi có khai báo UTF-8 sớm để ký tự đặc biệt hiển thị đúng không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Agent thêm thẻ meta charset với giá trị UTF-8 làm phần tử đầu tiên trong head của trang, nằm trong 1024 byte đầu của tài liệu.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Declare UTF-8 character encoding

Missing or incorrect charset causes mojibake (garbled text), broken special characters, and security vulnerabilities from character encoding attacks.

Quick Reference

  • Add <meta charset="UTF-8"> as the first element in <head>
  • Must appear within the first 1024 bytes of the document
  • UTF-8 supports all languages and special characters

Check

Verify that this HTML document declares UTF-8 character encoding in the head section and that it's positioned early in the document.

Fix

Add <meta charset="UTF-8"> as the first meta tag in the head section of the HTML document.

Explain

Explain why UTF-8 character encoding is essential for international content support and preventing character display issues.

Code Review

Review templates, server-rendered HTML, and shared components that output markup related to Declare UTF-8 character encoding. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/html/charset

Câu hỏi thường gặp

Mojibake là gì?

Skill dùng từ này để chỉ văn bản bị lỗi, xuất hiện khi các ký tự được đọc với sai bảng mã.

Vì sao khai báo phải nằm sớm?

Skill nói nó phải xuất hiện trong 1024 byte đầu của tài liệu.

UTF-8 có hỗ trợ mọi ngôn ngữ không?

Skill nói UTF-8 hỗ trợ mọi ngôn ngữ và ký tự đặc biệt.

Chi tiết

Mô tả gốc của tác giả

Use when reviewing templates, rendered HTML, or shared components related to Declare UTF-8 character encoding. Validate the final browser-facing markup, not just the source framework abstraction.

repo: thedaviddias/Front-End-Checklist

Độ phổ biến

Sao GitHub
75k
Vị trí xếp hạng
#2771
Giấy phép
MIT
Cập nhật
31/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự