<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://idugov.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ADecodeEncode%2Fdoc</id>
	<title>Module:DecodeEncode/doc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://idugov.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ADecodeEncode%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://idugov.com/w/index.php?title=Module:DecodeEncode/doc&amp;action=history"/>
	<updated>2026-04-18T20:17:33Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://idugov.com/w/index.php?title=Module:DecodeEncode/doc&amp;diff=31342&amp;oldid=prev</id>
		<title>Sanctaria: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://idugov.com/w/index.php?title=Module:DecodeEncode/doc&amp;diff=31342&amp;oldid=prev"/>
		<updated>2023-03-11T23:04:16Z</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;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 18:04, 11 March 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&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;!-- diff cache key idugovco_theixlpp_mw19678-mws9_:diff:1.41:old-31341:rev-31342 --&gt;
&lt;/table&gt;</summary>
		<author><name>Sanctaria</name></author>
	</entry>
	<entry>
		<id>https://idugov.com/w/index.php?title=Module:DecodeEncode/doc&amp;diff=31341&amp;oldid=prev</id>
		<title>en&gt;Paine Ellsworth: High-use template and update /doc</title>
		<link rel="alternate" type="text/html" href="https://idugov.com/w/index.php?title=Module:DecodeEncode/doc&amp;diff=31341&amp;oldid=prev"/>
		<updated>2023-02-17T08:38:23Z</updated>

		<summary type="html">&lt;p&gt;High-use template and update /doc&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Module rating |general}} &lt;br /&gt;
&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
{{High-use}}&lt;br /&gt;
&lt;br /&gt;
Implements Lua functions [[:mw:Extension:Scribunto/Lua_reference_manual#mw.text.decode|mw.text.decode]], [[:mw:Extension:Scribunto/Lua_reference_manual#mw.text.encode|mw.text.encode]] in a module.&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:decodeEncode|decode|s=Source&amp;amp;amp;nbsp;text&amp;amp;amp;copy;}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;Source&amp;amp;nbsp;text&amp;amp;copy;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See [[List of XML and HTML character entity references]].&lt;br /&gt;
&lt;br /&gt;
== Decode ({{mono|1=&amp;amp;amp;copy;}} &amp;amp;rarr; ©) &amp;lt;span class=&amp;quot;anchor&amp;quot; id=&amp;quot;Decode&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;==&lt;br /&gt;
{{hatnote|See {{slink||Known issues}} for possible THIN SPACE, epsilon issues}}&lt;br /&gt;
:Decodes [[List of XML and HTML character entity references|Named Entities]] ''from'' entity name ''into'' a regular (unicode) character:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;amp;amp;copy;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;&amp;amp;copy;&amp;lt;/code&amp;gt;&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;amp;amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All welldefined named entities are decoded ([https://html.spec.whatwg.org/multipage/named-characters.html#named-character-references HTML Named character references], formally: as defined in the [https://www.php.net/get_html_translation_table PHP table]).&lt;br /&gt;
&lt;br /&gt;
:A regular, rendered sentence:&lt;br /&gt;
::&amp;quot;At 100 °F, &amp;amp; with a &amp;quot;burning&amp;quot; sun above, we , we ⁄walked⁄.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:In code:&lt;br /&gt;
::&amp;quot;&amp;lt;code&amp;gt;At 100&amp;amp;amp;nbsp;&amp;amp;amp;deg;F, &amp;amp;amp; with a &amp;amp;amp;quot;burning&amp;amp;amp;quot; sun above, we &amp;amp;amp;frasl;walked&amp;amp;amp;frasl;.&amp;lt;/code&amp;gt;&amp;quot; -- wikitext&lt;br /&gt;
&lt;br /&gt;
:Processing:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:decodeEncode|decode|s=At 100&amp;amp;nbsp;&amp;amp;deg;F, &amp;amp;amp; with a &amp;amp;quot;burning&amp;amp;quot; sun above, we &amp;amp;frasl;walked&amp;amp;frasl;.}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; &amp;amp;rarr;&lt;br /&gt;
::&amp;lt;code&amp;gt;{{#invoke:decodeEncode|decode|s=At 100&amp;amp;nbsp;&amp;amp;deg;F, &amp;amp;amp; with a &amp;amp;quot;burning&amp;amp;quot; sun above, we &amp;amp;frasl;walked&amp;amp;frasl;.}}&amp;lt;/code&amp;gt; -- In code: straight characters, no named entities.&lt;br /&gt;
&lt;br /&gt;
:Renders, again:&lt;br /&gt;
::&amp;quot;At 100 °F, &amp;amp; with a &amp;quot;burning&amp;quot; sun above, we ⁄walked⁄.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
===Decode a reduced set only===&lt;br /&gt;
By setting {{para|subset_only|true}}, only these five entity names are decoded: '&amp;amp;amp;lt;', '&amp;amp;amp;gt;', '&amp;amp;amp;amp;', '&amp;amp;amp;quot;', '&amp;amp;amp;nbsp;' (that is, into '&amp;amp;lt;', '&amp;amp;gt;', '&amp;amp;amp;', '&amp;amp;quot;', '&amp;amp;nbsp;').&lt;br /&gt;
&lt;br /&gt;
:'''Note''': There is a difference with the relevant Lua parameter. (This only concerns your task if you also work directly with the Lua mw.text.decode function). Lua documentation defines parameter {{para|decodeNamedEntities}}, having this effect: when ''omitted or false'', only the reduced set of entities is recognized and decoded. This use of 'false' is ''inverted'' in using {{para|subset_only}}: {{para|decodeNamedEntities|false}} =  {{para|subset_only|true}}.&lt;br /&gt;
&lt;br /&gt;
:Also, this module ignores the &amp;quot;omitted&amp;quot; logic: {{para|subset_only}} should be set explicitly to 'true' to be effective.&lt;br /&gt;
&lt;br /&gt;
== Encode (© &amp;amp;rarr; {{mono|1=&amp;amp;amp;copy;}}) &amp;lt;span class=&amp;quot;anchor&amp;quot; id=&amp;quot;Encode&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;==&lt;br /&gt;
:Function &amp;lt;code&amp;gt;encode&amp;lt;/code&amp;gt; encodes some entity-named characters into that name (for example: &amp;lt;code&amp;gt;&amp;amp;&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;&amp;amp;amp;amp;&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Regular sentence:&lt;br /&gt;
:&amp;quot;At &amp;gt;100 °F, &amp;amp; with a &amp;quot;burning&amp;quot; sun above, we walked. ©&amp;quot;&lt;br /&gt;
&lt;br /&gt;
In code:&lt;br /&gt;
:&amp;quot;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;At &amp;gt;100 °F, &amp;amp; with a &amp;quot;burning&amp;quot; sun above, we walked. ©&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Encode:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:decodeEncode|encode|s=At &amp;gt;100 °F, &amp;amp; with a &amp;quot;burning&amp;quot; sun above, we walked. ©|charset=&amp;amp;&amp;lt;&amp;gt;{{!}}°&amp;quot;'&amp;amp;©}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:&amp;amp;rarr;&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;At &amp;amp;amp;gt;100 &amp;amp;amp;#176;F, &amp;amp;amp;amp; with a &amp;amp;amp;quot;burning&amp;amp;amp;quot; sun above, we walked. &amp;amp;amp;#169;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;!-- used Special:ExpandTemplate --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Renders as:&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;At &amp;amp;gt;100 &amp;amp;#176;F, &amp;amp;amp; with a &amp;amp;quot;burning&amp;amp;quot; sun above, we walked. &amp;amp;#169;&amp;quot;&lt;br /&gt;
===character set to encode===&lt;br /&gt;
&lt;br /&gt;
Per Lua documentation, only a small set of characters is processed. The characterset can be set (expanded) by using {{para|charset}}.&lt;br /&gt;
&lt;br /&gt;
:Example: {{para|charset|&amp;lt;nowiki&amp;gt;&amp;lt;&amp;gt;&amp;quot; \'&amp;amp;&amp;lt;/nowiki&amp;gt;}} (the default), {{para|charset|&amp;lt;nowiki&amp;gt;&amp;lt;&amp;gt;°&amp;quot;'&amp;amp;©{{!}}&amp;lt;/nowiki&amp;gt;}}; characters not in the default will be replaced by their decimal entity: &amp;lt;code&amp;gt;©&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;&amp;amp;amp;#169;&amp;lt;/code&amp;gt; &amp;lt;small&amp;gt;(hexadecimal number, not decimal nor named &amp;amp;amp;copy;)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Known issues &amp;lt;span class=&amp;quot;anchor&amp;quot; id=&amp;quot;Template&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;==&lt;br /&gt;
* 13 Sep 2021: NOTE: The encode function with user-supplied charset is now used productively  in {{tl|R/superscript}} and {{tl|R/ref}}. Before implementing breaking changes here, these templates need to be adjusted accordingly!&lt;br /&gt;
&lt;br /&gt;
* 26 Sep 2021: {{unichar|2009|THIN SPACE|html=}} &lt;br /&gt;
:Note: Possible bug: Decoding &amp;lt;code&amp;gt;&amp;amp;amp;ThinSpace;&amp;lt;/code&amp;gt; works, but &amp;lt;code&amp;gt;&amp;amp;amp;thinsp;&amp;lt;/code&amp;gt; doesn't.&lt;br /&gt;
:Resolved in code.&lt;br /&gt;
&lt;br /&gt;
*  4 Feb 2023: {{unichar|03B5|GREEK SMALL LETTER EPSILON|html=}}&lt;br /&gt;
{{tracked|T328840}}&lt;br /&gt;
:See {{slink|Module_talk:DecodeEncode|Bug_report:_bad_decoding_of_U+03B5_ε_(epsilon)}}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[:mw:Extension:Scribunto/Lua_reference_manual#mw.text.decode|mw.text.decode]]&lt;br /&gt;
* [[:mw:Extension:Scribunto/Lua_reference_manual#mw.text.encode|mw.text.encode]]&lt;br /&gt;
* [[:Module:Urldecode]]&lt;br /&gt;
&lt;br /&gt;
{{Navbox wikitext-handling templates}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Wikitext processing templates]]&lt;br /&gt;
[[Category:Modules that manipulate strings]]&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>en&gt;Paine Ellsworth</name></author>
	</entry>
</feed>