Module:User:Suzukaze-c/unicode

Hello, you have come here looking for the meaning of the word Module:User:Suzukaze-c/unicode. In DICTIOUS you will not only get to know all the dictionary meanings for the word Module:User:Suzukaze-c/unicode, but we will also tell you about its etymology, its characteristics and you will know how to say Module:User:Suzukaze-c/unicode in singular and plural. Everything you need to know about the word Module:User:Suzukaze-c/unicode you have here. The definition of the word Module:User:Suzukaze-c/unicode will help you to be more precise and correct when speaking or writing your texts. Knowing the definition ofModule:User:Suzukaze-c/unicode, as well as those of other words, enriches your vocabulary and provides you with more and better linguistic resources.

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