มาตรฐาน Unicode

จุดรหัส

ค่าตัวเลขในพื้นที่รหัส Unicode (U+0000 ถึง U+10FFFF) เขียนในรูปแบบ U+XXXX ไม่ใช่ทุกจุดรหัสที่จะถูกกำหนดให้กับอักขระ

· Updated

What is a Code Point?

A code point is the fundamental unit of the Unicode standard: a unique integer assigned to a single character, symbol, or abstract entity. Code points are written in the format U+XXXX where the Xs are hexadecimal digits — for example, U+0041 for the Latin capital letter A, or U+1F600 for the grinning face emoji 😀.

The Unicode code space spans from U+0000 to U+10FFFF, providing 1,114,112 possible positions. Not every position is occupied — as of Unicode 16.0, approximately 154,998 are assigned. The rest are either unassigned, reserved, or permanently set aside as noncharacters.

Anatomy of a Code Point Notation

U+1F600
│ │────┘
│  └── Hexadecimal value (6 digits for supplementary, 4 for BMP)
└───── "U+" prefix (Unicode notation)

Decimal equivalent: 128,512
Binary: 1 1111 0110 0000 0000

The "U+" prefix is a notation convention; it is not part of the value itself. When code points appear in source code or data, they use encoding-specific escape sequences instead:

Language Escape syntax Example (U+1F600)
Python \U0001F600 "\U0001F600"
JavaScript \u{1F600} "\u{1F600}"
Java surrogate pair "\uD83D\uDE00"
CSS \1F600 content: "\1F600"
HTML 😀 😀
Rust \u{1F600} '\u{1F600}'

Code Points vs Characters

A code point is not always identical to what a user perceives as a "character" (called a grapheme cluster). Consider:

é  can be represented as:
  U+00E9  (LATIN SMALL LETTER E WITH ACUTE — single code point)
  U+0065 + U+0301  (e + combining acute accent — two code points)

🏳️‍🌈  (rainbow flag) is:
  U+1F3F3 + U+FE0F + U+200D + U+1F308  (four code points, one visible character)

This distinction matters for string length calculations, cursor movement, and text editing.

Ranges and Planes

Code points are organized into 17 planes of 65,536 values each:

  • Plane 0 (U+0000–U+FFFF): Basic Multilingual Plane — most everyday characters
  • Plane 1 (U+10000–U+1FFFF): Supplementary Multilingual Plane — historic scripts, emoji
  • Plane 2 (U+20000–U+2FFFF): Supplementary Ideographic Plane — CJK extension ideographs
  • Planes 3–13: Mostly unassigned
  • Plane 14 (U+E0000–U+EFFFF): Tags (language tags, variation selectors)
  • Planes 15–16 (U+F0000–U+10FFFF): Private Use Areas

Common Pitfalls

String length confusion: In many languages, length returns the number of code units (bytes or 16-bit words), not code points, and neither matches the number of visible characters.

s = "😀"
len(s)          # Python 3: 1 (correct — one code point)
len(s.encode()) # 4 (bytes in UTF-8)
"😀".length       // 2 (UTF-16 surrogate pair!)
[..."😀"].length  // 1 (iterating by code point)

BMP assumption: Legacy code that assumes all characters fit in 16 bits (a BMP-only assumption) breaks on emoji, historic scripts, and rare CJK extensions.

Quick Facts

Property Value
Notation U+XXXX (4–6 hex digits)
Minimum U+0000 (NULL)
Maximum U+10FFFF
Total possible 1,114,112
Assigned (v16.0) ~154,998
First emoji U+00AE ® (registered sign, Unicode 1.1)
Highest assigned emoji U+1FAE8 (shaking face, v15.0)

คำศัพท์ที่เกี่ยวข้อง

เพิ่มเติมใน มาตรฐาน Unicode

Basic Multilingual Plane (BMP)

ระนาบ 0 (U+0000–U+FFFF) ประกอบด้วยอักขระที่ใช้บ่อยที่สุด ได้แก่ Latin, Greek, Cyrillic, CJK, Arabic และสัญลักษณ์ส่วนใหญ่ อักขระในระนาบนี้พอดีกับหนึ่งหน่วยรหัส …

CJK

จีน ญี่ปุ่น และเกาหลี คำรวมสำหรับบล็อกอักษรจีน Han ที่รวมกันและอักษรที่เกี่ยวข้องใน Unicode CJK Unified Ideographs มีอักขระมากกว่า 20,992 …

Han Unification

The process of mapping Chinese, Japanese, and Korean ideographs that share a …

Hangul Jamo

The individual consonant and vowel components (jamo) of the Korean Hangul writing …

ISO 10646 / Universal Character Set

มาตรฐานสากล (ISO/IEC 10646) ที่ซิงโครไนซ์กับ Unicode กำหนดชุดอักขระและจุดรหัสเดียวกัน แต่ไม่มีอัลกอริธึมและคุณสมบัติเพิ่มเติมของ Unicode

Unicode

มาตรฐานการเข้ารหัสอักขระสากลที่กำหนดหมายเลขเฉพาะ (จุดรหัส) ให้กับทุกอักขระในทุกระบบการเขียน เวอร์ชัน 16.0 มีอักขระที่กำหนดแล้ว 154,998 ตัว

Unicode Character Database (UCD)

คอลเลกชันไฟล์ข้อมูลที่อ่านได้ด้วยเครื่องซึ่งกำหนดคุณสมบัติอักขระ Unicode ทั้งหมด รวมถึง UnicodeData.txt, Blocks.txt, Scripts.txt และอื่นๆ

Unicode Standard Annex (UAX)

Normative or informative documents that are integral parts of the Unicode Standard. …

Unicode Technical Report (UTR)

Informational documents published by the Unicode Consortium covering specific topics like security …

ค่าสเกลาร์ Unicode

จุดรหัสใดๆ ยกเว้นจุดรหัส surrogate (U+D800–U+DFFF) ชุดค่าที่ถูกต้องซึ่งสามารถแทนอักขระจริงได้ รวมทั้งสิ้น 1,112,064 ค่า