local export = {}
local u = mw.ustring.char
local a, b, c = u(0xF000), u(0xF001), u(0xF002)
local oneChar = {
= "г" .. a, = "е" .. a, = "е" .. b, = "и", = "и" .. a, = "и" .. c, = "щ" .. a, = "я" .. a, = "я" .. b
}
function export.makeSortKey(text, lang, sc)
text = mw.ustring.gsub(mw.ustring.lower(text), "и", "и" .. b) -- ensure "и" comes after "і" and "ї"
return mw.ustring.upper(mw.ustring.gsub(text, ".", oneChar))
end
return export