<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.pttlink.org/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.pttlink.org/index.php?action=history&amp;feed=atom&amp;title=Module%3ADecodeEncode"/>
	<link rel="alternate" type="text/html" href="https://wiki.pttlink.org/index.php?title=Module:DecodeEncode&amp;action=history"/>
	<updated>2026-06-13T03:03:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.5</generator>
	<entry>
		<id>https://wiki.pttlink.org/index.php?title=Module:DecodeEncode&amp;diff=6605&amp;oldid=prev</id>
		<title>Kg7qin: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.pttlink.org/index.php?title=Module:DecodeEncode&amp;diff=6605&amp;oldid=prev"/>
		<updated>2022-01-21T17:28:43Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:28, 21 January 2022&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key mediawiki:diff::1.12:old-5928:rev-6605 --&gt;
&lt;/table&gt;</summary>
		<author><name>Kg7qin</name></author>
	</entry>
	<entry>
		<id>https://wiki.pttlink.org/index.php?title=Module:DecodeEncode&amp;diff=5928&amp;oldid=prev</id>
		<title>Kg7qin: Created page with &quot;local p = {}  function _getBoolean( boolean_str ) 	-- from: module:String; adapted 	-- requires an explicit true 	local boolean_value  	if type( boolean_str ) == 'string' then...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.pttlink.org/index.php?title=Module:DecodeEncode&amp;diff=5928&amp;oldid=prev"/>
		<updated>2022-01-20T23:03:15Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {}  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...&amp;quot;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:03, 20 January 2022&lt;/td&gt;
				&lt;/tr&gt;
&lt;!-- diff cache key mediawiki:diff::1.12:old-6604:rev-5928 --&gt;
&lt;/table&gt;</summary>
		<author><name>Kg7qin</name></author>
	</entry>
	<entry>
		<id>https://wiki.pttlink.org/index.php?title=Module:DecodeEncode&amp;diff=6604&amp;oldid=prev</id>
		<title>Mediawiki&gt;Matthiaspaul: add workaround for &amp; thinsp ;</title>
		<link rel="alternate" type="text/html" href="https://wiki.pttlink.org/index.php?title=Module:DecodeEncode&amp;diff=6604&amp;oldid=prev"/>
		<updated>2021-09-26T13:15:07Z</updated>

		<summary type="html">&lt;p&gt;add workaround for &amp;amp; thinsp ;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
	local subset_only &lt;br /&gt;
&lt;br /&gt;
	s = frame.args['s'] or ''&lt;br /&gt;
	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;
	local ret = nil;&lt;br /&gt;
&lt;br /&gt;
    s = mw.ustring.gsub( s, '&amp;amp;thinsp;', '&amp;amp;ThinSpace;' ) -- Workaround for bug: &amp;amp;ThinSpace; gets properly decoded in decode, but &amp;amp;thinsp; doesn't.&lt;br /&gt;
&lt;br /&gt;
	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&lt;br /&gt;
	local charset&lt;br /&gt;
&lt;br /&gt;
	s = frame.args['s'] or ''&lt;br /&gt;
	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 ~= (nil or '') 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>Mediawiki&gt;Matthiaspaul</name></author>
	</entry>
</feed>