URLENCODE(1)
πΈ URLENCODE(1) β the GridSite Manual glow-up πΈ
okay bestie, sit down, hydrate, because today we're talking about urlencode β the little GridSite icon that turns your strings into URL-encoded form and back again. it's giving translator, it's giving glue code, it's giving "why is there a %20 in my link" β¨
π NAME π
urlencode β convert strings to or from URL-encoded form π
π¦ SYNOPSIS π¦
urlencode [-m|-d] string [string ...]
like, that's it. that's the whole thing. no cap. π«Ά
β¨ DESCRIPTION β¨
so urlencode encodes strings according to RFC 1738. yes, a whole RFC. she's official. π
here's the tea: the characters A-Z a-z 0-9 . _ and - get passed through unmodified β they're the chosen ones, they don't get touched. but literally every other character gets represented as %HH, where HH is its two-digit upper-case hexadecimal ASCII representation. periodt.
for example, the URL
http://www.gridpp.ac.uk/
becomes
http%3A%2F%2Fwww.gridpp.ac.uk%2F
see how the slashes and the colon got jumped? iconic behaviour honestly π
and here's the part that matters: urlencode converts each character in all the strings given on the command line. and if you give it multiple strings? they get concatenated with separating spaces before conversion. so yes, the spaces are part of the deal. πΈ
π OPTIONS π
-mβ instead of the full conversion, do GridSite's "mild URL encoding", whereA-Za-z0-9.=-_@and/are all passed through unmodified. this gives you slightly more human-readable strings, which, slay. but the application must be prepared to create or simulate the directories implied by any slashes. so like, don't just vibe with the slashes, the app has to actually handle them. π₯-dβ do URL-decoding rather than encoding, according to RFC 1738.%HHand%hhstrings get converted, and every other character is passed through unmodified β with the exception that+gets converted to a space. yeah, the plus sign is a space in disguise. plot twist. π
π EXIT CODES π
0 is always returned.
always. literally always. she does not fail, she does not complain, she just returns 0 and minds her business. a queen. π
π§ AUTHOR π§
Andrew McNab <Andrew.McNab@manchester.ac.uk>
and also, for the record: urlencode is part of GridSite: http://www.gridsite.org/ π¦
quick vibe check before you go: this is the GridSite Manual version of the page, for urlencode, dated November 2003. so if you're reading this in the group chat years later, know that this little page has been doing its job since way back. π
stay encoded, bestie. β¨ππ«Ά
π¦ where this page comes from
- debian bookworm: gridsite-clients 3.0.0~20230214gitee81151-1+b1 Β· BSD-2-Clause
- debian trixie: gridsite-clients 3.0.0~20240125git1200598-1.1 Β· BSD-2-Clause
- epel 9: gridsite-clients 3.0.0-0.25.20230214gitee81151.el9 Β· Apache-2.0 AND BSD-2-Clause
- fedora 43: gridsite-clients 3.0.0-0.33.20240125git1200598.fc43 Β· Apache-2.0 AND BSD-2-Clause
- fedora 43: gridsite-clients 3.0.0-0.36.20260121git7a7b764.fc43 Β· Apache-2.0 AND BSD-2-Clause
- fedora 44: gridsite-clients 3.0.0-0.36.20260121git7a7b764.fc44 Β· Apache-2.0 AND BSD-2-Clause
- ubuntu jammy: gridsite-clients 3.0.0~20180202git2fdbc6f-3build3 Β· BSD-2-Clause
- ubuntu noble: gridsite-clients 3.0.0~20230214gitee81151-1.1build3 Β· BSD-2-Clause
- ubuntu questing: gridsite-clients 3.0.0~20240125git1200598-1.1build1
- ubuntu resolute: gridsite-clients 3.0.0~20240125git1200598-2build1 Β· BSD-2-Clause
- ubuntu stonking: gridsite-clients 3.0.0~20240125git1200598-3build1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms