コンテンツへスキップ
uencoder

文字 設定 比較

Side-によって-side 比較 の ASCII, Latin-1, UTF-8, UTF-16, および UTF-32 エンコード characteristics.

Encoding Width Comparison

Character encodings differ in how many bytes each code point consumes and whether the width is fixed or variable. Fixed-width encodings simplify indexing but waste space for ASCII-heavy text. Variable-width encodings optimize storage at the cost of random access. Choosing the right encoding depends on the dominant script, memory constraints, and interoperability requirements of the target system.

ASCII
7-bit, 128 code points, single byte
A = 0x41
Latin-1 (ISO-8859-1)
8-bit, 256 code points, single byte
é = 0xE9
UTF-8
Variable 1-4 bytes, ASCII compatible
中 = 3 bytes
UTF-16
Variable 2 or 4 bytes (surrogates)
A = 2 bytes
UTF-32
Fixed 4 bytes per code point
A = 4 bytes

Compatibility and Endianness

UTF-8 is byte-oriented and has no endianness concern, which makes it the safest default for interchange. UTF-16 and UTF-32 are word-oriented and require a Byte Order Mark (BOM) or explicit endianness declaration to disambiguate. Big-endian and little-endian variants produce different byte sequences for the same text. A BOM of U+FEFF at the start of a stream signals the byte order to decoders.

Storage Efficiency

For predominantly Latin text, UTF-8 is the most compact Unicode encoding, using one byte per character. For CJK text, UTF-8 uses three bytes per character while UTF-16 uses two, making UTF-16 more efficient for East Asian content. UTF-32 is never the most efficient choice for storage but offers the fastest code point indexing. Real-world systems often pick UTF-8 for transport and convert internally as needed.

関連ツール

参考链接