l<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://climatewiki.earth/wiki/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://climatewiki.earth/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ADecodeEncode"/>
	<link rel="alternate" type="text/html" href="https://climatewiki.earth/wiki/index.php?title=Module:DecodeEncode&amp;action=history"/>
	<updated>2026-05-05T03:40:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.1</generator>
	<entry>
		<id>https://climatewiki.earth/wiki/index.php?title=Module:DecodeEncode&amp;diff=9967&amp;oldid=prev</id>
		<title>BranchOut: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://climatewiki.earth/wiki/index.php?title=Module:DecodeEncode&amp;diff=9967&amp;oldid=prev"/>
		<updated>2024-01-15T19:28:17Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:28, 15 January 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>BranchOut</name></author>
	</entry>
	<entry>
		<id>https://climatewiki.earth/wiki/index.php?title=Module:DecodeEncode&amp;diff=9966&amp;oldid=prev</id>
		<title>Wikipedia&gt;Lemondoge: Fixed error (`a ~= (nil or '')` doesn't work; change to `a and a ~= ''`).</title>
		<link rel="alternate" type="text/html" href="https://climatewiki.earth/wiki/index.php?title=Module:DecodeEncode&amp;diff=9966&amp;oldid=prev"/>
		<updated>2023-04-17T20:18:54Z</updated>

		<summary type="html">&lt;p&gt;Fixed error (`a ~= (nil or &amp;#039;&amp;#039;)` doesn&amp;#039;t work; change to `a and a ~= &amp;#039;&amp;#039;`).&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require('strict')&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 ) == 'string' then&lt;br /&gt;
		boolean_str = boolean_str:lower()&lt;br /&gt;
		if boolean_str == 'true' or boolean_str == 'yes' or boolean_str == '1' 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 ) == 'boolean' 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['s'] or ''&lt;br /&gt;
	local subset_only = _getBoolean(frame.args['subset_only'] 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;amp;thinsp;', '&amp;amp;ThinSpace;' )&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;amp;epsilon;', '&amp;amp;epsi;' )&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['s'] or ''&lt;br /&gt;
	local charset = frame.args['charset']&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;amp;©−°\\\&amp;quot;\'\=' -- do escape with backslash not %;&lt;br /&gt;
	local ret&lt;br /&gt;
&lt;br /&gt;
	if charset and charset ~= '' then&lt;br /&gt;
		ret = mw.text.encode( s, charset )&lt;br /&gt;
	else&lt;br /&gt;
		-- use default: chartset = '&amp;lt;&amp;gt;&amp;amp;&amp;quot;\' ' (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>Wikipedia&gt;Lemondoge</name></author>
	</entry>
</feed>