<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://ufed.world/wikipedia/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnicode_data%2Fscripts%2Fdoc</id>
	<title>Module:Unicode data/scripts/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://ufed.world/wikipedia/index.php?action=history&amp;feed=atom&amp;title=Module%3AUnicode_data%2Fscripts%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://ufed.world/wikipedia/index.php?title=Module:Unicode_data/scripts/doc&amp;action=history"/>
	<updated>2026-07-29T13:56:15Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>https://ufed.world/wikipedia/index.php?title=Module:Unicode_data/scripts/doc&amp;diff=520&amp;oldid=prev</id>
		<title>Polasciana: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://ufed.world/wikipedia/index.php?title=Module:Unicode_data/scripts/doc&amp;diff=520&amp;oldid=prev"/>
		<updated>2019-02-09T19:40:49Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:40, 9 February 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Polasciana</name></author>
	</entry>
	<entry>
		<id>https://ufed.world/wikipedia/index.php?title=Module:Unicode_data/scripts/doc&amp;diff=519&amp;oldid=prev</id>
		<title>en&gt;Erutuon: Unicode version number, add description</title>
		<link rel="alternate" type="text/html" href="https://ufed.world/wikipedia/index.php?title=Module:Unicode_data/scripts/doc&amp;diff=519&amp;oldid=prev"/>
		<updated>2019-01-24T21:44:07Z</updated>

		<summary type="html">&lt;p&gt;Unicode version number, add description&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
{{high risk|265468}}&lt;br /&gt;
&lt;br /&gt;
This module contains data that is used by [[Module:Unicode data]] to determine the Unicode script code for a code point and to determine if a Unicode script is written right-to-left. The right-to-left script data is sourced from [[Module:Lang/data]].&lt;br /&gt;
&lt;br /&gt;
== Creation ==&lt;br /&gt;
&lt;br /&gt;
Extracted from Scripts.txt and PropertyValueAliases.txt from the Unicode Character Database (version 11.0) using two scripts shown below, written in Lua 5.3 and using [http://www.inf.puc-rio.br/~roberto/lpeg/lpeg.html LPeg]. The scripts must be in the same folder as the two data files, and you must have a global function named &amp;quot;sortedpairs&amp;quot; that can iterate over integer keys in a sparse table in numerical order. (The sortedPairs function in [[wikt:Module:table|Module:table]] on English Wiktionary will work.)&lt;br /&gt;
&lt;br /&gt;
{{collapse top|title=Lua 5.3 scripts}}&lt;br /&gt;
; make_script_data.lua&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local lpeg = require &amp;#039;lpeg&amp;#039;&lt;br /&gt;
local infilehandle = assert(io.open(&amp;#039;./Scripts.txt&amp;#039;, &amp;#039;rb&amp;#039;))&lt;br /&gt;
local scriptdata = assert(infilehandle:read &amp;#039;a&amp;#039;)&lt;br /&gt;
infilehandle:close()&lt;br /&gt;
local outfile = &amp;#039;./data.lua&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local script_name_to_code = dofile &amp;#039;./name_to_code.lua&amp;#039;&lt;br /&gt;
&lt;br /&gt;
for k, v in pairs(lpeg) do&lt;br /&gt;
	local firstletter = k:sub(1, 1)&lt;br /&gt;
	if firstletter:upper() == firstletter then&lt;br /&gt;
		_ENV[k] = v&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function numtohex(number)&lt;br /&gt;
	return (&amp;#039;%04X&amp;#039;):format(number)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function hextonum(hex)&lt;br /&gt;
	return tonumber(hex, 16)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Create table that contains arrays of codepoint ranges as well as codepoint-to-script fields.&lt;br /&gt;
-- Need separate tables for map and ranges.&lt;br /&gt;
local prev&lt;br /&gt;
local maxscriptnamelen = 0&lt;br /&gt;
local function process(t, cp1, cp2, scriptname, ...)&lt;br /&gt;
	if not scriptname then return t end&lt;br /&gt;
	&lt;br /&gt;
	local script_code = script_name_to_code[scriptname]&lt;br /&gt;
	&lt;br /&gt;
	local rangearray = t.ranges[script_code] -- Place in script-specific array initially.&lt;br /&gt;
	if not rangearray then&lt;br /&gt;
		rangearray = {}&lt;br /&gt;
		t.ranges[script_code] = rangearray&lt;br /&gt;
		prev = nil&lt;br /&gt;
	end&lt;br /&gt;
	local cpnumber1, cpnumber2&lt;br /&gt;
	cpnumber1 = hextonum(cp1)&lt;br /&gt;
	if cp2 then&lt;br /&gt;
		cpnumber2 = hextonum(cp2)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if prev and cpnumber1 == prev + 1 then&lt;br /&gt;
		if t.individual[prev] then -- Move individual condepoint to previously created range.&lt;br /&gt;
			t.individual[prev] = nil&lt;br /&gt;
			table.insert(rangearray, { prev, cpnumber2 or cpnumber1, script_code })&lt;br /&gt;
		else&lt;br /&gt;
			rangearray[#rangearray][2] = cpnumber2 or cpnumber1 -- Increment top of previous codepoint range.&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		if cpnumber2 then&lt;br /&gt;
			table.insert(rangearray, { cpnumber1, cpnumber2, script_code })&lt;br /&gt;
		else&lt;br /&gt;
			t.individual[cpnumber1] = script_code&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	prev = cpnumber2 or cpnumber1&lt;br /&gt;
	&lt;br /&gt;
	return t&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local patt = P {&lt;br /&gt;
	Cf((Cc{ ranges = {}, individual = {} } * V &amp;#039;patt&amp;#039; + 1)^1, process),&lt;br /&gt;
	patt       =  V &amp;#039;nl&amp;#039;        * (Cg(V &amp;#039;data_line&amp;#039;) + V &amp;#039;comment&amp;#039;),&lt;br /&gt;
	data_line  =  V &amp;#039;cprange&amp;#039;   *  V &amp;#039;opts&amp;#039;&lt;br /&gt;
		       *  P &amp;#039;;&amp;#039;         *  V &amp;#039;opts&amp;#039;      * C(V &amp;#039;scriptname&amp;#039;) * V &amp;#039;opts&amp;#039;&lt;br /&gt;
			   * (V &amp;#039;count&amp;#039;     *  V &amp;#039;opts&amp;#039;)^-1&lt;br /&gt;
		       *  P &amp;#039;#&amp;#039;         *  V &amp;#039;opts&amp;#039;      * V &amp;#039;category&amp;#039;      * V &amp;#039;opts&amp;#039;&lt;br /&gt;
			   *  V &amp;#039;not_nl&amp;#039;,&lt;br /&gt;
	comment    =  P &amp;#039;#&amp;#039;         *  V &amp;#039;not_nl&amp;#039;,&lt;br /&gt;
	&lt;br /&gt;
	count      = &amp;#039;[&amp;#039; * R &amp;#039;09&amp;#039;^1 * &amp;#039;]&amp;#039;,&lt;br /&gt;
	category   = R &amp;#039;AZ&amp;#039; * R(&amp;#039;az&amp;#039;, &amp;#039;&amp;amp;&amp;amp;&amp;#039;),&lt;br /&gt;
	scriptname = R(&amp;#039;AZ&amp;#039;, &amp;#039;az&amp;#039;, &amp;#039;__&amp;#039;)^1, -- Actually starts with capital and rest is alphabetic or underscore.&lt;br /&gt;
	cprange    = C(V &amp;#039;cp&amp;#039;) * (P &amp;#039;..&amp;#039; * C(V &amp;#039;cp&amp;#039;) + Cc(nil)), -- XXXX; XXXX..XXXX -&amp;gt; string, string; string, nil&lt;br /&gt;
	&lt;br /&gt;
	not_nl     = (1 - V &amp;#039;nl&amp;#039;)^0,&lt;br /&gt;
	cp         = V &amp;#039;hex&amp;#039; * V &amp;#039;hex&amp;#039; * V &amp;#039;hex&amp;#039; * V &amp;#039;hex&amp;#039; * V &amp;#039;hex&amp;#039;^-1,-- maximum of 5 hex digits&lt;br /&gt;
	hex        = R(&amp;#039;09&amp;#039;, &amp;#039;AF&amp;#039;, &amp;#039;af&amp;#039;), -- Actually just 0-9A-F.&lt;br /&gt;
	opts       = S &amp;#039; \t&amp;#039;^0, -- Actually just space.&lt;br /&gt;
	nl         = P &amp;#039;\r&amp;#039;^-1 * P &amp;#039;\n&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local scriptdatatable = patt:match(scriptdata)&lt;br /&gt;
&lt;br /&gt;
-- Move arrays for individual scripts to a single array.&lt;br /&gt;
local i = 0&lt;br /&gt;
local new_ranges = {}&lt;br /&gt;
for script, ranges in pairs(scriptdatatable.ranges) do&lt;br /&gt;
	for _, range in ipairs(ranges) do&lt;br /&gt;
		i = i + 1&lt;br /&gt;
		new_ranges[i] = range&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
scriptdatatable.ranges = new_ranges&lt;br /&gt;
&lt;br /&gt;
table.sort(&lt;br /&gt;
	scriptdatatable.ranges,&lt;br /&gt;
	function (range1, range2)&lt;br /&gt;
		return range1[1] &amp;lt; range2[1]&lt;br /&gt;
	end)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- P R I N T   R E S U L T&lt;br /&gt;
local out = assert(io.open(outfile, &amp;#039;wb&amp;#039;))&lt;br /&gt;
&lt;br /&gt;
out:write [[&lt;br /&gt;
-- Generated by make_script_data.lua.&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	individual = {&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
for cp, script in sortedpairs(scriptdatatable.individual) do&lt;br /&gt;
	out:write((&amp;#039;\t\t[0x%05X] = &amp;quot;%s&amp;quot;,\n&amp;#039;):format(cp, script))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
out:write[[&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	ranges = {&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
for _, range in ipairs(scriptdatatable.ranges) do&lt;br /&gt;
	out:write((&amp;#039;\t\t{ 0x%05X, 0x%05X, %-&amp;#039; .. maxscriptnamelen .. &amp;#039;s },\n&amp;#039;)&lt;br /&gt;
		:format(range[1], range[2], (&amp;#039;%q&amp;#039;):format(range[3])))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
out:write [[&lt;br /&gt;
	},&lt;br /&gt;
}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
assert(out:close())&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
; name_to_code.lua&lt;br /&gt;
&amp;lt;source lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local lpeg = require &amp;#039;lpeg&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local property_value_aliases_filename = &amp;quot;./PropertyValueAliases.txt&amp;quot;&lt;br /&gt;
local property_value_aliases = assert(io.open(property_value_aliases_filename, &amp;#039;rb&amp;#039;)):read(&amp;#039;a&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
for k, v in pairs(lpeg) do&lt;br /&gt;
	local firstletter = k:sub(1, 1)&lt;br /&gt;
	if firstletter:upper() == firstletter then&lt;br /&gt;
		_ENV[k] = v&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local script_name_to_code = {}&lt;br /&gt;
&lt;br /&gt;
local function add_to_table(code, name)&lt;br /&gt;
	script_name_to_code[name] = code&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local patt = P {&lt;br /&gt;
	(V &amp;#039;script_line&amp;#039; / add_to_table + 1)^1,&lt;br /&gt;
	script_line = V &amp;#039;nl&amp;#039; * P &amp;#039;sc&amp;#039; * V &amp;#039;sep&amp;#039; * C(V &amp;#039;code&amp;#039;) * V &amp;#039;sep&amp;#039; * C(V &amp;#039;name&amp;#039;) * (P(1) - V &amp;#039;nl&amp;#039;)^0,&lt;br /&gt;
	code = R &amp;#039;AZ&amp;#039; * V &amp;#039;lower&amp;#039; * V &amp;#039;lower&amp;#039; * V &amp;#039;lower&amp;#039;,&lt;br /&gt;
	name = R(&amp;#039;AZ&amp;#039;, &amp;#039;az&amp;#039;, &amp;#039;__&amp;#039;)^1,&lt;br /&gt;
	lower = R &amp;#039;az&amp;#039;,&lt;br /&gt;
	sep = V &amp;#039;w&amp;#039; * P &amp;#039;;&amp;#039; * V &amp;#039;w&amp;#039;,&lt;br /&gt;
	w = S &amp;#039; \t&amp;#039;^0,&lt;br /&gt;
	nl = P &amp;#039;\r&amp;#039;^-1 * P &amp;#039;\n&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
patt:match(property_value_aliases)&lt;br /&gt;
&lt;br /&gt;
return script_name_to_code&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
{{collapse bottom}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox | |&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>en&gt;Erutuon</name></author>
	</entry>
</feed>