Module:Text: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
m
de>Mps
mNo edit summary
de>Mps
Line 1:
--[=[ 20142015-0901-2715
Text utilities
]=]
Line 336:
-- removes all diacritics from the input string, by decomposing the characters, removing the combining diacritical marks and recomposing the remaining characters
function p.removeDiacritics(frame)
local combiningDiacriticalMarks = "[" ..
local combiningDiacriticalMarks = "[" .. mw.ustring.char(0x0300) .. "-" .. mw.ustring.char(0x036F) .. mw.ustring.char(0x1AB0) .. "-" .. mw.ustring.char(0x1AFF) .. mw.ustring.char(0x1DC0) .. "-" .. mw.ustring.char(0x1DFF) .. "]"
mw.ustring.char(0x0300) .. "-" .. mw.ustring.char(0x036F) ..
mw.ustring.char(0x1AB0) .. "-" .. mw.ustring.char(0x1AFF) ..
mw.ustring.char(0x1DC0) .. "-" .. mw.ustring.char(0x1DFF) ..
mw.ustring.char(0xFE20) .. "-" .. mw.ustring.char(0xFE2F) ..
"]"
return mw.ustring.toNFC(mw.ustring.gsub(mw.ustring.toNFD(frame.args[1] or ""), combiningDiacriticalMarks, ""))
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu