I am researching RTL scripts. I met this:
I am researching RTL scripts. I met this:
I'd expect the Arab, Hebr, Nkoo characters to be rtl=true. Am I misunderstanding something? @Erutuon: -DePiep (talk) 20:58, 9 January 2021 (UTC)
{{#invoke:Unicode data|is|rtl|05E9}} checks whether the literal characters 05E9 are right-to-left. To check the right-to-leftness of the Hebrew character, put in the literal character or a HTML character reference: {{#invoke:Unicode data|is|rtl|ש}} or {{#invoke:Unicode data|is|rtl|ש}}. #invoke:Unicode data|is|rtl as well as #invoke:Unicode data|is|valid_pagename and #invoke:Unicode data|is|Latin interpret their arguments as strings rather than code points in hexadecimal because the corresponding functions in the module take strings. (They could take hexadecimal arguments if someone edited the module to add another parameter to tell them to interpret their argument this way.) — Eru·tuon 01:02, 10 January 2021 (UTC){{#invoke:Unicode data|is|rtl|ש}}). -DePiep (talk) 17:28, 10 January 2021 (UTC)In the function is_pagename, does "pagename" stand for "blockname"? Or wider? -DePiep (talk) 05:17, 27 March 2022 (UTC)
I am developing the documentation, especially in Module:Unicode data § List of functions. To completify, can someone point out how or where the data /aliases and /Hangul can be retrieved (implementation)? DePiep (talk) 11:39, 27 March 2022 (UTC)
About U+0634 ش ARABIC LETTER SHEEN [4]:
I expect true (is_rtl), right? -DePiep (talk) 23:00, 28 March 2022 (UTC)
This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Description of suggested change: the module code says "-- No image data modules on Wikipedia yet."
We have them now. Can this be enabled? — Alexis Jazz (talk or ping me) 05:37, 20 November 2023 (UTC)
{{#invoke:Unicode data/sandbox|lookup|image|0xA9}} returns Unicode 0x00A9.svg (File:Unicode 0x00A9.svg) so I think this works? — Alexis Jazz (talk or ping me) 21:19, 20 November 2023 (UTC)This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Description of suggested change: Creation of p.is_noncharacter() as a separate function
Diff:
| − | function p. | + | function p.is_noncharacter(codepoint)
-- U+FDD0-U+FDEF and all code points ending in FFFE or FFFF are Unassigned
-- (Cn) and specifically noncharacters:
-- https://www.unicode.org/faq/private_use.html#nonchar4
return 0xFDD0 <= codepoint and (codepoint <= 0xFDEF
or floor(codepoint % 0x10000) >= 0xFFFE)
end
function p.lookup_name(codepoint)
if is_noncharacter(codepoint) then
return ("<noncharacter-%04X>"):format(codepoint)
end |
Eievie (talk) 20:48, 20 April 2024 (UTC)
This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Description of suggested change:
Allow looking up the kCantonese Unihan property. As an example, {{#invoke:Unicode data/sandbox|lookup|kCantonese|20EB6}} returns "naap6".
Diff:
function p.lookup_kCantonese(codepoint)
local data = loader[('Unihan/kCantonese/%02X'):format(floor(codepoint / 0x1000))]
if data then
return data[codepoint]
end
end
Northern Moonlight 03:54, 1 January 2025 (UTC)
This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Description of suggested change:
Reorder the name_hooks table so its entries are sorted in codepoint order. binary_range_search assumes the entries are sorted in this way currently and therefore does not work correctly. {{unichar}} is currently broken by this bug as can be seen in CJK Unified Ideographs Extension I § Background. Specifically U+2ED9D CJK UNIFIED IDEOGRAPH-2ED9D and U+2EDE0 CJK UNIFIED IDEOGRAPH-2EDE0 incorrectly appear as reserved. I have made the change in the sandbox.
Diff:
See comparison of sandbox with main Warudo (talk) 12:20, 15 June 2025 (UTC)
| − | -- For the algorithm used to generate Hangul Syllable names,
-- see "Hangul Syllable Name Generation" in section 3.12 of the
-- Unicode Specification:
-- https://www.unicode.org/versions/Unicode11.0.0/ch03.pdf
local name_hooks = {
{ 0x00, 0x1F, "<control-%04X>" }, -- C0 control characters
{ 0x7F, 0x9F, "<control-%04X>" }, -- DEL and C1 control characters
{ 0x3400, 0x4DBF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension A
{ 0x4E00, 0x9FFF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph
{ 0xAC00, 0xD7A3, function (codepoint) -- Hangul Syllables
local Hangul_data = loader.Hangul
local syllable_index = codepoint - 0xAC00
return ("HANGUL SYLLABLE %s%s%s"):format(
Hangul_data.leads[floor(syllable_index / Hangul_data.final_count)],
Hangul_data.vowels[floor((syllable_index % Hangul_data.final_count)
/ Hangul_data.trail_count)],
Hangul_data.trails[syllable_index % Hangul_data.trail_count]
)
end },
-- High Surrogates, High Private Use Surrogates, Low Surrogates
{ 0xD800, 0xDFFF, "<surrogate-%04X>" },
{ 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use
-- CJK Compatibility Ideographs
{ 0xF900, 0xFA6D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xFA70, 0xFAD9, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0x17000, 0x187F7, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph
{ 0x18800, 0x18AFF, function (codepoint)
return ("TANGUT COMPONENT-%03d"):format(codepoint - 0x187FF)
end },
{ 0x18D00, 0x18D08, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph Supplement
{ 0x1B170, 0x1B2FB, "NUSHU CHARACTER-%04X" }, -- Nushu
{ 0x20000, 0x2A6DF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension B
{ 0x2A700, 0x2B739, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension C
{ 0x2B740, 0x2B81D, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension D
{ 0x2B820, 0x2CEA1, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension E
{ 0x2CEB0, 0x2EBE0, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension F | + | -- For the algorithm used to generate Hangul Syllable names,
-- see "Hangul Syllable Name Generation" in section 3.12 of the
-- Unicode Specification:
-- https://www.unicode.org/versions/Unicode11.0.0/ch03.pdf
-- binary_range_search assumes these are ordered by codepoint. Do not place them in a random order!
local name_hooks = {
{ 0x00, 0x1F, "<control-%04X>" }, -- C0 control characters
{ 0x7F, 0x9F, "<control-%04X>" }, -- DEL and C1 control characters
{ 0x3400, 0x4DBF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension A
{ 0x4E00, 0x9FFF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph
{ 0xAC00, 0xD7A3, function (codepoint) -- Hangul Syllables
local Hangul_data = loader.Hangul
local syllable_index = codepoint - 0xAC00
return ("HANGUL SYLLABLE %s%s%s"):format(
Hangul_data.leads[floor(syllable_index / Hangul_data.final_count)],
Hangul_data.vowels[floor((syllable_index % Hangul_data.final_count)
/ Hangul_data.trail_count)],
Hangul_data.trails[syllable_index % Hangul_data.trail_count]
)
end },
-- High Surrogates, High Private Use Surrogates, Low Surrogates
{ 0xD800, 0xDFFF, "<surrogate-%04X>" },
{ 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use
-- CJK Compatibility Ideographs
{ 0xF900, 0xFA6D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xFA70, 0xFAD9, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0x17000, 0x187F7, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph
{ 0x18800, 0x18AFF, function (codepoint)
return ("TANGUT COMPONENT-%03d"):format(codepoint - 0x187FF)
end },
{ 0x18D00, 0x18D08, "TANGUT IDEOGRAPH-%04X" }, -- Tangut Ideograph Supplement
{ 0x1B170, 0x1B2FB, "NUSHU CHARACTER-%04X" }, -- Nushu
{ 0x20000, 0x2A6DF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension B
{ 0x2A700, 0x2B739, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension C
{ 0x2B740, 0x2B81D, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension D
{ 0x2B820, 0x2CEA1, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension E
{ 0x2CEB0, 0x2EBE0, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension F
{ 0x2EBF0, 0x2EE5D, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension I
{ 0x2F800, 0x2FA1D, "CJK COMPATIBILITY IDEOGRAPH-%04X" }, -- CJK Compatibility Ideographs Supplement (Supplementary Ideographic Plane)
{ 0x30000, 0x3134A, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension G
{ 0x31350, 0x323AF, "CJK UNIFIED IDEOGRAPH-%04X" }, -- CJK Ideograph Extension H
{ 0xE0100, 0xE01EF, function (codepoint) -- Variation Selectors Supplement
return ("VARIATION SELECTOR-%d"):format(codepoint - 0xE0100 + 17)
end},
{ 0xF0000, 0xFFFFD, "<private-use-%04X>" }, -- Plane 15 Private Use
{ 0x100000, 0x10FFFD, "<private-use-%04X>" } -- Plane 16 Private Use
} |
--Warudo (talk) 13:56, 15 June 2025 (UTC)
This edit request has been answered. Set the |answered= parameter to no to reactivate your request. |
Description of suggested change:
Add Variation Selectors (not to be confused with Variation Selectors Supplement) to the name_hooks list. This fixes Template_talk:Unichar#c-Great_Brightstar-20250729153400-Some_character_names_are_not_found_by_the_template properly. (I've added the characters to c:Data:Unicode_data/names/00F.tab but that is a hack and should be reverted once the proper fix is done here.) I've provided the code in the Sandbox which was copied over from wikt:Module:Unicode data which handles this correctly.
Diff:
| − | { 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use | + | { 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use
{ 0xFE00, 0xFE0F, function (codepoint) -- Variation Selectors
return ("VARIATION SELECTOR-%d"):format(codepoint - 0xFE00 + 1)
end},
-- CJK Compatibility Ideographs |
Warudo (talk) 16:17, 29 July 2025 (UTC)
| − | { 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use | + | { 0xE000, 0xF8FF, "<private-use-%04X>" }, -- Private Use
-- CJK Compatibility Ideographs
{ 0xF900, 0xFA6D, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xFA70, 0xFAD9, "CJK COMPATIBILITY IDEOGRAPH-%04X" },
{ 0xFE00, 0xFE0F, function (codepoint) -- Variation Selectors
return ("VARIATION SELECTOR-%d"):format(codepoint - 0xFE00 + 1)
end}, |
I missed this because the temporary fix in Commons masked the problem. I can confirm that this time I tested the change properly by reverting my fix in commons first. Warudo (talk) 16:39, 2 August 2025 (UTC)
User:Dušan Kreheľ made edits like this which basically eliminated the need for these sub-pages. Can Module:Unicode data be refactored to not call these and just handle the function directly? In Module:Unicode data/names/00F for example the code is require("Module:Unicode data/datasets").dataset("Unicode data/names/00F.tab") where the 00F is already known as that is the name of the sub-module page. Gonnym (talk) 17:59, 17 November 2025 (UTC)
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.