URL decoding: Difference between revisions
UNIX Shell: add alternative: printf -> echo
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
(UNIX Shell: add alternative: printf -> echo) |
||
Line 1,708:
<syntaxhighlight lang="bash">urldecode() { local u="${1//+/ }"; printf '%b' "${u//%/\\x}"; }</syntaxhighlight>
Alternative: Replace <code>printf '%b' "${u//%/\\x}"</code> with <code>echo -e "${u//%/\\x}"</code>
Example:
Line 1,717 ⟶ 1,719:
google.com/search?q=`Abdu'l-Bahároot@
</syntaxhighlight>
<syntaxhighlight lang="bash">function urldecode
|