GOLF(2gg)

πŸ“¦ version 601.4.41, in ubuntu questing

πŸ’– GOLF(2gg) πŸ’–

okay bestie, welcome to the GOLF(2gg) manual page, Development edition ✨ this one is short, sweet, and lowkey essential β€” let's get into it 🫢


✨ NAME ✨

decode-url β€” (URL-encoding)


🎯 PURPOSE 🎯

Decode URL-encoded string. that's it, that's the whole job, and it ate πŸ’…


πŸ“œ SYNTAX πŸ“œ

decode-url <string> [ input-length <length> ] [ status <status> ]

🌸 DESCRIPTION 🌸

okay so decode-url will decode <string> (the kind created by encode-url or other URL-encoding software) and store the result back into <string> β€” yes, in place, she's not giving you a copy back, she's editing the original πŸ’€

not me about to say the most important thing ever: if you need <string> unchanged, make a copy of it first with copy-string. fr fr. do it BEFORE you run this. i'm serious πŸ™ˆ

<length> in the input-length clause specifies the number of bytes to decode. if it's omitted or negative, it's the string length of <string> β€” so like, the whole thing, no cap.

All encoded values (starting with %) are decoded, and + (plus sign) is converted to space. periodt πŸ’–

<status> number (in the status clause) is GG_OKAY if all bytes decoded successfully πŸŽ‰ or, in case of an error, it is the index of the byte that could not be decoded (first byte is indexed 0). so if there's an error (for example a hexadecimal value following % is invalid), the decoding stops, and whatever was decoded up to that point is the result. it's giving "we got as far as we got" 😭


πŸ“ EXAMPLES πŸ“

Decode URL-encoded string "str", after which it will hold a decoded string.

decode-url str

look at her go, iconic behavior πŸ‘‘


πŸ‘€ SEE ALSO πŸ‘€

  • URL encoding
  • decode-url encode-url See all documentation

and that's the whole vibe check, bestie πŸ¦‹ this was the GOLF(2gg) page from $VERSION, dated $DATE β€” go decode something cute, and remember: copy your string first πŸ’œβœ¨

πŸ“¦ where this page comes from