Module:Unicode data/doc

本模組用於存取 Unicode 字元資料庫(16.0 版),該資料庫源自 Unicode 字元資料庫(UCD)中的檔案。

函數

以下所有函數只能在模組中使用。對於可在模板中呼叫的函數,請參見 Module:Unicode data/templates

lookup_name
查詢碼位的名稱。由 Module:character infoModule:character listModule:alsoModule:mul-domino def 使用。
lookup_image
查詢碼位的圖像。由 Module:character infoModule:character list 使用。
enum_blocks
Module:character listfor in 迴圈中用於遍歷區塊範圍陣列。
lookup_plane
返回碼位所屬的平面名稱。目前未使用。
get_block_range
給定區塊名稱,返回該區塊包含的碼位範圍。由 Module:character list 使用。
is_valid_pagename
給定字串,根據該字串是否可用作頁面標題返回 truefalse
add_dotted_circle
給定字串,在字串中每個組合字元前放置一個虛線圓圈。由 Module:grc-utilities 使用。
lookup_script
給定碼位,使用 Module:Unicode data/scripts 返回 Unicode 腳本代碼。
get_entry_title
返回字元條目的標題,對於不能出現在頁面名稱中的字元,標題是 不支援的頁面名稱的子頁面。有關更多資訊,請參閱 MediaWiki 網站上的 Manual:頁面標題。由 Module:character infoModule:character list 使用。

以下函數與碼位的 General Category 相關。它們接收一個碼位並返回兩個值:一個布林值(表示該碼位是否滿足條件)和一個描述通用類別的字串(如果字元屬於分隔符(Z)或其他(C)通用類別),或字串 "assigned"。它們使用 Module:Unicode data/control

is_assigned
檢查碼位的通用類別是否不是 Cn(其他,未分配)。由 Module:character list 使用。
is_printable
檢查碼位是否可列印:其通用類別不是「其他」(C)、「分隔符,行」(Zl),或「分隔符,段落」(Zp)。由 Module:character infoModule:character list 使用。
is_whitespace
檢查碼位的通用類別是否為 Zs(「分隔符,空格」)。由 Module:character listModule:links/print data 使用。

資料模組

本模組函數使用的資料位於 子頁面 上。

名稱和圖像資料模組(Module:Unicode data/names/xxxModule:Unicode data/images/xxx)是從 UnicodeData.txt 編譯而來。每個模組最多包含從 U+xxx000 到 U+xxxFFF 的碼位。然而,以下範圍內的名稱由此基礎模組自動生成,不需要單獨的名稱模組:

BMP: 0000–001F(C0 控制字元), 007F–009F(DEL 和 C1 控制字元), 3400–4DBF(中日韓),
4E00–9FFF(中日韓), AC00–D7A3(諺文), D800–DFFF(代理), E000–F8FF(私用), F900–FAFF(中日韓)
SMP: 17000–18AFF(西夏文), 18B00–18CD5(契丹文), 18D00–18D08(西夏文), 1B170–1B2FB(女書)
平面 2–3(中日韓)
平面 14: E0100–E01EF(變體選擇符)
平面 15–16(私用)
Unicode name 和 image 模塊,
前三碼組成以十六進位代碼點為基礎
0 1 2 3 4 5 6 7 8 9 A B C D E F
00x names
images
names
images
names
images
names
images
names
images

images

images

images

images

images
names
images

images

images
names
images
names
images
01x names
images
names
images
names
images
names
images
names
images
names
images

images
names
images
names
images
names
images
names
images
names
images
names
images
names
images
02x
images

images

images

images

images

images

images

images

images

images

images

images

images

images

images
names
images
03x
images

images

images
0Ex names
images

更新

每當發布新的 Unicode 版本時,需要更新幾個子模組,有時還需要更新主模組中的名稱規則。名稱區塊控制字元組合字元類別模組是由 User:Kephir/Unicode 中給出的腳本構建的;腳本通用類別模組是由 Wikipedia 上的模組生成的。大多數名稱規則在 Unicode 核心規範的 第 4 章 第 4.8 節(名稱)中給出,其他規則是手動添加的,每個 Unicode 版本可能需要擴展這些規則適用的字元範圍。

Module:Unicode data/Hangul 和諺文音節名稱規則永遠不需要更新。

更新這些模組後,還需要更新 Module:character list 中的版本號。

版權

Unicode 資料庫由 Unicode Inc. 根據以下條款發布:

Copyright © 1991-2022 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in https://www.unicode.org/copyright.html.

Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the "Data Files") or Unicode software and any associated documentation (the "Software") to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies of the Data Files or Software, or (b) this copyright and permission notice appear in associated Documentation.

THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE.

Except as contained in this notice, the name of a copyright holder shall not be used in advertising or otherwise to promote the sale, use or other dealings in these Data Files or Software without prior written authorization of the copyright holder.

Category:有过多高开销解析器函数调用的页面