mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-25 08:36:21 +00:00
b3da8a698d
This also makes some updates to make-normalization-table.php to handle the move of UtfNormal to a separate library. Bug: T126427 Change-Id: Id4985c3ca441cf92f08ba1f1af85c762ba43d7d2
34 lines
957 B
Lua
34 lines
957 B
Lua
local function tohex( s )
|
|
local t = { s }
|
|
for c in mw.ustring.gcodepoint( s ) do
|
|
t[#t + 1] = string.format( "%x", c )
|
|
end
|
|
return table.concat( t, '\t' )
|
|
end
|
|
|
|
return {
|
|
run = function ( c1, c2, c3, c4, c5 )
|
|
return
|
|
tohex( mw.ustring.toNFC( c1 ) ),
|
|
tohex( mw.ustring.toNFC( c2 ) ),
|
|
tohex( mw.ustring.toNFC( c3 ) ),
|
|
tohex( mw.ustring.toNFC( c4 ) ),
|
|
tohex( mw.ustring.toNFC( c5 ) ),
|
|
tohex( mw.ustring.toNFD( c1 ) ),
|
|
tohex( mw.ustring.toNFD( c2 ) ),
|
|
tohex( mw.ustring.toNFD( c3 ) ),
|
|
tohex( mw.ustring.toNFD( c4 ) ),
|
|
tohex( mw.ustring.toNFD( c5 ) ),
|
|
tohex( mw.ustring.toNFKC( c1 ) ),
|
|
tohex( mw.ustring.toNFKC( c2 ) ),
|
|
tohex( mw.ustring.toNFKC( c3 ) ),
|
|
tohex( mw.ustring.toNFKC( c4 ) ),
|
|
tohex( mw.ustring.toNFKC( c5 ) ),
|
|
tohex( mw.ustring.toNFKD( c1 ) ),
|
|
tohex( mw.ustring.toNFKD( c2 ) ),
|
|
tohex( mw.ustring.toNFKD( c3 ) ),
|
|
tohex( mw.ustring.toNFKD( c4 ) ),
|
|
tohex( mw.ustring.toNFKD( c5 ) )
|
|
end
|
|
}
|