プロパティ

スクリプト

文字が属する文字体系(例:ラテン、キリル、漢字)。Unicode 16.0は168個のスクリプトを定義し、Scriptプロパティはセキュリティと混在スクリプト検出に重要です。

· Updated

What Is a Unicode Script?

A Unicode Script is a collection of characters used to write one or more human languages. Unlike blocks (which are contiguous code-point ranges), a script groups characters by their cultural and historical writing system: Latin, Arabic, Han, Devanagari, Georgian, and so on. Unicode 15.1 defines 161 scripts.

Every assigned character carries a Script property value. Characters not associated with any specific writing system receive the value Common (punctuation, digits, emoji) or Inherited (combining marks that inherit the script of their base character, such as combining diacritical marks).

Script vs. Block

The distinction is important in practice:

  • The Latin script spans dozens of blocks: Basic Latin, Latin-1 Supplement, Latin Extended-A through Latin Extended-G, IPA Extensions, and more.
  • The CJK Unified Ideographs block contains characters that belong to multiple scripts (Han, and historically Bopomofo components).
  • The Letterlike Symbols block is Script=Common because those symbols are used across many writing systems.
# Python 3.14+ exposes Script via unicodedata
import unicodedata

# unicodedata.script() — available in Python 3.14
for char in ["A", "α", "ب", "あ", "中"]:
    try:
        script = unicodedata.script(char)
    except AttributeError:
        script = "(requires Python 3.14)"
    print(f"{char}  Script={script}")

# A  Script=Latin
# α  Script=Greek
# ب  Script=Arabic
# あ Script=Hiragana
# 中 Script=Han

# On older Python, use the 'regex' package:
import regex
print(bool(regex.match(r'\p{Script=Latin}', 'A')))     # True
print(bool(regex.match(r'\p{Script=Arabic}', 'ب')))    # True

Script Extensions

Some characters are legitimately used in more than one script. The Script_Extensions property lists all scripts that use a given character. For example, U+0951 DEVANAGARI STRESS SIGN UDATTA appears in Devanagari, Bengali, Gujarati, and a dozen other Indic scripts—its Script is Inherited, but its Script_Extensions lists all the scripts that employ it. Implementations that need precise script-segmentation should consult Script_Extensions rather than Script alone.

# regex package supports Script_Extensions:
import regex
# Match a character used in the Devanagari OR Bengali script
pattern = regex.compile(r'[\p{Script_Extensions=Devanagari}\p{Script_Extensions=Bengali}]')

Quick Facts

Property Value
Unicode property name Script
Short alias sc
Number of scripts (Unicode 15.1) 161
Special values Common, Inherited, Unknown
Python 3.14 unicodedata.script(char)
Older Python regex package, \p{Script=Latin}
Companion property Script_Extensions (scx)
Spec reference Unicode Standard Annex #24 (UAX #24)

関連用語

プロパティ のその他の用語

Age プロパティ

文字が最初に割り当てられたUnicodeバージョン。システムやソフトウェアバージョン間での文字サポートを判断するのに役立ちます。

East Asian Width

Unicode property (UAX#11) classifying characters as Narrow, Wide, Fullwidth, Halfwidth, Ambiguous, or …

Joining Type

Unicode property controlling how Arabic and Syriac characters connect to adjacent characters. …

Script Extensions

Unicode property listing all scripts that use a character, broader than the …

ケースマッピング

文字を大文字・小文字・タイトルケースに変換するルール。ロケール依存の場合があり(トルコ語のI問題)、1対多のマッピングもあります(ß → SS)。

デフォルト無視文字

サポートしていないプロセスで目に見える効果なく無視できる文字で、異体字セレクター・ゼロ幅文字・言語タグなどが含まれます。

ブロック

名前付きの連続したコードポイント範囲(例:基本ラテン = U+0000〜U+007F)。Unicode 16.0は336個のブロックを定義し、すべてのコードポイントはちょうど1つのブロックに属します。

ミラープロパティ

RTLコンテキストでグリフを水平に反転すべき文字。例:( → )、[ → ]、{ → }、« → »。

一般カテゴリー

すべてのコードポイントを30個のカテゴリ(Lu・Ll・Nd・Soなど)の1つに分類する体系で、7つの主要クラス(文字・記号・数字・句読点・記号・区切り・その他)にグループ化されています。

互換等価

同じ抽象的内容を持つが外観が異なる場合がある2つの文字シーケンス。正規等価より広い概念。例:fi ≈ fi、² ≈ 2。