{rawurldecode:string}

Description

Decodes a percent-encoded (URL-encoded) string back to its original text, following RFC 3986 exactly the way PHP rawurldecode does. Every %XX sequence becomes the byte it stands for: %20 becomes a space, %2F a slash, %3D an equals sign, %26 an ampersand. This is the inverse of rawurlencode and the correct decoder for modern URLs and query values. The one difference from the older urldecode command: a literal plus sign is left as a plus, NOT turned into a space (only %20 means space here). Invalid or incomplete sequences are passed through unchanged. The command never caches and never trims its input.

Parameters

string required

The percent-encoded text to decode. Each %XX is turned back into its byte; %20 becomes a space. A literal plus sign stays a plus (unlike the older urldecode command). Passed through unchanged if it contains no valid %XX sequences.

Examples

test{rawurldecode:Praha%201}
ExpectedPraha 1
ActualPraha 1
A percent-encoded space (%20) becomes a real space. This is the everyday case: turning an encoded value back into readable text.
test{rawurldecode:q%3D1%26r%3D2}
Expectedq=1&r=2
Actualq=1&r=2
Reserved URL characters come back too: %3D is an equals sign and %26 an ampersand, so an encoded query string q%3D1%26r%3D2 decodes to q=1&r=2.
test{rawurldecode:novinky%2F2026}
Expectednovinky/2026
Actualnovinky/2026
A slash is encoded as %2F inside a single path segment; rawurldecode restores it to a literal slash.
test{rawurldecode:Praha+1}
ExpectedPraha+1
ActualPraha+1
The one behaviour that sets rawurldecode apart from the older urldecode command: a literal plus sign is left as a plus, not turned into a space. Only %20 means space here. Use rawurldecode for modern, RFC 3986 URLs.
test{rawurldecode:100%25 hotovo}
Expected100% hotovo
Actual100% hotovo
A percent sign that is part of the text is itself encoded as %25, so 100%25 decodes back to 100 percent.
test{rawurldecode:zelena louka}
Expectedzelena louka
Actualzelena louka
Text with no %XX sequences is returned unchanged - decoding an already-plain value is safe and does nothing.
test{rawurldecode:{rawurlencode:psi a kocky}}
Expectedpsi a kocky
Actualpsi a kocky
rawurldecode is the exact inverse of rawurlencode: encode a value and decode it again and you get the original string back. Useful as a sanity check or when a value was stored encoded.
test{rawurldecode:https%3A%2F%2Fexample.org%2Fhledat%3Fq%3Dpsi%20utulek}
Expectedhttps://example.org/hledat?q=psi utulek
Actualhttps://example.org/hledat?q=psi utulek
A fully percent-encoded URL (every : and / written as %3A and %2F) decodes back to the readable address. Because nothing in the input is a bare colon, the command does not mis-split on it.