UTF-32

Encoding & Standards

ترميز Unicode ثابت العرض يستخدم 4 بايت بالضبط لكل حرف، مما يوفر تعيينًا مباشرًا لنقاط الرمز على حساب المساحة.

UTF-32 is the simplest Unicode encoding: every character uses exactly 4 bytes, and the value directly corresponds to the code point. This makes random access and character counting trivial.

However, UTF-32 uses 4x the memory of ASCII text and 2x that of UTF-16 for most common characters. It's rarely used for storage or transmission but can be convenient for internal string processing.

Python 3's internal string representation uses a variable-width encoding (Latin-1, UCS-2, or UCS-4) depending on the highest code point in the string, which is why `len('😀')` correctly returns 1.

المصطلحات ذات الصلة

BOM (BOM) BOM (BOM)
علامة ترتيب البايت (U+FEFF) توضع في بداية الملف النصي للإشارة إلى ترتيب البايت (الإنهاء) في ترميزات UTF-16/UTF-32.
UTF-16 UTF-16
ترميز Unicode متغير العرض يستخدم 2 أو 4 بايت لكل حرف، وتستخدمه JavaScript وJava وWindows داخليًا.
UTF-8 UTF-8
ترميز Unicode متغير العرض يستخدم من 1 إلى 4 بايت لكل حرف، وهو الترميز السائد على الويب (تستخدمه 98%+ من المواقع).
وحدة الرمز وحدة الرمز
أصغر مجموعة بتات تُستخدم لترميز حرف: 8 بت لـ UTF-8، و16 بتًا لـ UTF-16، و32 بتًا لـ UTF-32.

الأدوات ذات الصلة

🔢 بحث Unicode بحث Unicode
أدخل نقطة كود مثل U+1F600 واحصل على الرمز التعبيري وتفاصيل الترميز وبايتات UTF-8/16 وكيانات HTML.