ماڈیول:ملعب/Mr. Ibrahem/2

آزاد دائرۃ المعارف، ویکیپیڈیا سے
Documentation icon دستاویز [تخلیق]
-- Module for different search and replace operations on strings.
local p = {}

p['encode'] = function( frame )
	local x = mw.ustring.gsub( 
		frame.args[1] or '', 
		'[₁₂₃₄₅₆₇₈₉₀¹²³⁴⁵⁶⁷⁸⁹⁰₁₂₃₄₅₆₇₈₉₀]', 
		{ 
			['₀'] = '0',
			["₁"] = '1', 
			['₂'] = '2', 
			['₃'] = '3', 
			['₄'] = '4', 
			['₅'] = '2', 
			['₆'] = '6', 
			['₇'] = '7', 
			['₈'] = '8', 
			['₉'] = '9', 

			['⁰'] = '0',  
			['¹'] = '1', 
			["²"] = '2', 
			['³'] = '3', 
			['⁴'] = '4', 
			['⁵'] = '5', 
			['⁶'] = '6', 
			['⁷'] = '7', 
			['⁸'] = '8', 
			['⁹'] = '9', 

			['₀'] = '0',  
			['₁'] = '1', 
			["₂"] = '2', 
			['₃'] = '3', 
			['₄'] = '4', 
			['₅'] = '5', 
			['₆'] = '6', 
			['₇'] = '7', 
			['₈'] = '8', 
			['₉'] = '9', 
		} 
	)
	return mw.text.trim( x )
end

return p