Jump to content

Template:Urldecode/doc

From Wikinews, the free news source you can write!

Usage

[edit]

This template undoes the transformation of magic word {{urlencode:}}. For example, {{urlencode:Côte d'Ivoire}} produces C%C3%B4te+d%27Ivoire, while {{urldecode|C%C3%B4te+d%27Ivoire}} or {{urldecode|{{urlencode:Côte d'Ivoire}}}} produces Côte d'Ivoire.

An optional second argument specifies encoding QUERY, PATH, or WIKI (case-insensitive). These are the same three encodings supported by the magic word. The difference is that QUERY decodes + as a space, WIKI decodes _ as a space, and PATH does neither. Default is QUERY.

Examples

[edit]
markup produces

{{Urldecode|a+b c_d}}

a b c_d

{{Urldecode|a+b c_d|query}}

a b c_d

{{Urldecode|a+b c_d|path}}

a+b c_d

{{Urldecode|a+b c_d|wiki}}

a+b c d

Internals

[edit]

This template invokes Module:Urldecode.