ਸਮੱਗਰੀ 'ਤੇ ਜਾਓ

ਮੌਡਿਊਲ:Urldecode

ਵਿਕੀਪੀਡੀਆ, ਇੱਕ ਅਜ਼ਾਦ ਗਿਆਨਕੋਸ਼ ਤੋਂ
Kuldeepburjbhalaike (ਗੱਲ-ਬਾਤ | ਯੋਗਦਾਨ) ("local p = {} function p.urlDecode( frame ) local enctype = frame.args[2] local ret = nil; if (frame.args[2] ~= nil) then enctype = mw.ustring.upper(enctype) if ((enctype == "QUERY") or (enctype == "PATH") or (enctype == "WIKI")) then ret = mw.uri.decode(frame.args[1],frame.args[2]) end else ret = mw.uri.decode(frame.args[1]) end ret = string.gsub(ret, "{", "{") ret = string.gsub(ret, "}", "}") return ret end return p" ਨਾਲ਼ ਸਫ਼ਾ ਬਣਾਇਆ) ਦੁਆਰਾ ਕੀਤਾ ਗਿਆ 06:45, 17 ਜਨਵਰੀ 2023 ਦਾ ਦੁਹਰਾਅ
(ਫ਼ਰਕ) ←ਪੁਰਾਣਾ ਦੁਹਰਾਅ | ਸਭ ਤੋਂ ਨਵਾਂ ਦੁਹਰਾਅ (ਫ਼ਰਕ) | ਨਵਾਂ ਰੀਵਿਜ਼ਨ → (ਫ਼ਰਕ)

Functions

[ਸੋਧੋ]
  • Function urlDecode reverses the transformation by magic word {{urlencode:}}.
{{#invoke:Urldecode|urlDecode|C%C3%B4te+d%27Ivoire}}  would produce  Côte d'Ivoire

See also

[ਸੋਧੋ]

local p = {}

function p.urlDecode( frame )
	local enctype = frame.args[2]
	local ret = nil;
	if (frame.args[2] ~= nil) then
		enctype = mw.ustring.upper(enctype)
		if ((enctype == "QUERY") or (enctype == "PATH") or (enctype == "WIKI")) then
			ret = mw.uri.decode(frame.args[1],frame.args[2])
		end
	else
		ret = mw.uri.decode(frame.args[1])
	end
	ret = string.gsub(ret, "{", "{")
	ret = string.gsub(ret, "}", "}")

	return ret
end

return p