<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.tiffa.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ADecodeEncode</id>
	<title>Module:DecodeEncode - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.tiffa.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ADecodeEncode"/>
	<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Module:DecodeEncode&amp;action=history"/>
	<updated>2026-04-03T17:50:42Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://wiki.tiffa.net/w/index.php?title=Module:DecodeEncode&amp;diff=141162&amp;oldid=prev</id>
		<title>Fire: Created page with &quot;require(&#039;strict&#039;) local p = {}  local function _getBoolean( boolean_str ) 	-- from: module:String; adapted 	-- requires an explicit true 	local boolean_value  	if type( boolean_str ) == &#039;string&#039; then 		boolean_str = boolean_str:lower() 		if boolean_str == &#039;true&#039; or boolean_str == &#039;yes&#039; or boolean_str == &#039;1&#039; then 			boolean_value = true 		else 			boolean_value = false 		end 	elseif type( boolean_str ) == &#039;boolean&#039; then 		boolean_value = boolean_str 	else 		boolean_value =...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.tiffa.net/w/index.php?title=Module:DecodeEncode&amp;diff=141162&amp;oldid=prev"/>
		<updated>2024-04-20T07:10:51Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;require(&amp;#039;strict&amp;#039;) local p = {}  local function _getBoolean( boolean_str ) 	-- from: module:String; adapted 	-- requires an explicit true 	local boolean_value  	if type( boolean_str ) == &amp;#039;string&amp;#039; then 		boolean_str = boolean_str:lower() 		if boolean_str == &amp;#039;true&amp;#039; or boolean_str == &amp;#039;yes&amp;#039; or boolean_str == &amp;#039;1&amp;#039; then 			boolean_value = true 		else 			boolean_value = false 		end 	elseif type( boolean_str ) == &amp;#039;boolean&amp;#039; then 		boolean_value = boolean_str 	else 		boolean_value =...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function _getBoolean( boolean_str )&lt;br /&gt;
	-- from: module:String; adapted&lt;br /&gt;
	-- requires an explicit true&lt;br /&gt;
	local boolean_value&lt;br /&gt;
&lt;br /&gt;
	if type( boolean_str ) == &amp;#039;string&amp;#039; then&lt;br /&gt;
		boolean_str = boolean_str:lower()&lt;br /&gt;
		if boolean_str == &amp;#039;true&amp;#039; or boolean_str == &amp;#039;yes&amp;#039; or boolean_str == &amp;#039;1&amp;#039; then&lt;br /&gt;
			boolean_value = true&lt;br /&gt;
		else&lt;br /&gt;
			boolean_value = false&lt;br /&gt;
		end&lt;br /&gt;
	elseif type( boolean_str ) == &amp;#039;boolean&amp;#039; then&lt;br /&gt;
		boolean_value = boolean_str&lt;br /&gt;
	else&lt;br /&gt;
		boolean_value = false&lt;br /&gt;
	end&lt;br /&gt;
	return boolean_value&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.decode( frame )&lt;br /&gt;
	local s = frame.args[&amp;#039;s&amp;#039;] or &amp;#039;&amp;#039;&lt;br /&gt;
	local subset_only = _getBoolean(frame.args[&amp;#039;subset_only&amp;#039;] or false)&lt;br /&gt;
&lt;br /&gt;
	return p._decode( s, subset_only )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._decode( s, subset_only )&lt;br /&gt;
	-- U+2009 THIN SPACE: workaround for bug: HTML entity &amp;amp;thinsp; is decoded incorrect. Entity &amp;amp;ThinSpace; gets decoded properly&lt;br /&gt;
	s = mw.ustring.gsub( s, &amp;#039;&amp;amp;thinsp;&amp;#039;, &amp;#039;&amp;amp;ThinSpace;&amp;#039; )&lt;br /&gt;
	-- U+03B5 ε GREEK SMALL LETTER EPSILON: workaround for bug (phab:T328840): HTML entity &amp;amp;epsilon; is decoded incorrect for gsub(). Entity &amp;amp;epsi; gets decoded properly&lt;br /&gt;
	s = mw.ustring.gsub( s, &amp;#039;&amp;amp;epsilon;&amp;#039;, &amp;#039;&amp;amp;epsi;&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
	local ret = mw.text.decode( s, not subset_only )&lt;br /&gt;
&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.encode( frame )&lt;br /&gt;
	local s = frame.args[&amp;#039;s&amp;#039;] or &amp;#039;&amp;#039;&lt;br /&gt;
	local charset = frame.args[&amp;#039;charset&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
	return p._encode( s, charset )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._encode( s, charset )&lt;br /&gt;
	-- example: charset = &amp;#039;_&amp;amp;©−°\\\&amp;quot;\&amp;#039;\=&amp;#039; -- do escape with backslash not %;&lt;br /&gt;
	local ret&lt;br /&gt;
&lt;br /&gt;
	if charset and charset ~= &amp;#039;&amp;#039; then&lt;br /&gt;
		ret = mw.text.encode( s, charset )&lt;br /&gt;
	else&lt;br /&gt;
		-- use default: chartset = &amp;#039;&amp;lt;&amp;gt;&amp;amp;&amp;quot;\&amp;#039; &amp;#039; (outer quotes = lua required; space = NBSP)&lt;br /&gt;
		ret = mw.text.encode( s )&lt;br /&gt;
	end &lt;br /&gt;
	&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Fire</name></author>
	</entry>
</feed>