This is a private module sandbox of Suzukaze-c, for their own experimentation. Items in this module may be added and removed at Suzukaze-c's discretion; do not rely on this module's stability.
local export = {}
function export.show(text, prefix, case, separator)
if type(text) == "table" then
local a = text.args
text = a or nil
prefix = a or nil
case = a or nil
separator = a or nil
end
if not text then text = "test string" end
if not prefix then prefix = "U+" end
if not case then case = "upper" end
if not separator then separator = " " end
local cp = {}
for char in mw.text.gsplit(text, "") do
char = mw.ustring.codepoint(char)
char = string.format('%.4X', char) -- see ]
if case == "lower" then
char = string.lower(char)
end
table.insert(cp, prefix .. char)
end
return table.concat(cp, separator)
end
return export