ansible.builtin.urldecode filter – Decode percent-encoded sequences
Note
This filter plugin is part of ansible-core
and included in all Ansible
installations. In most cases, you can use the short
plugin name
urldecode
.
However, we recommend you use the Fully Qualified Collection Name (FQCN) ansible.builtin.urldecode
for easy linking to the
plugin documentation and to avoid conflicting with other collections that may have
the same filter plugin name.
Synopsis
Replace %xx escapes with their single-character equivalent in the given string.
Also replace plus signs with spaces, as required for unquoting HTML form values.
Input
This describes the input of the filter, the value before | ansible.builtin.urldecode
.
Parameter |
Comments |
---|---|
URL encoded string to decode. |
Examples
# Decode urlencoded string
{{ '%7e/abc+def' | urldecode }}
# => "~/abc def"
# Decode plus sign as well
{{ 'El+Ni%C3%B1o' | urldecode }}
# => "El Niño"
Return Value
Key |
Description |
---|---|
URL decoded value for the given string Returned: success |
Hint
Configuration entries for each entry type have a low to high priority order. For example, a variable that is lower in the list will override a variable that is higher up.