Skip to content

Instantly share code, notes, and snippets.

@glowinthedark
Last active February 24, 2026 12:46
Show Gist options
  • Select an option

  • Save glowinthedark/2ec3880982ff1d99a31a514518295c35 to your computer and use it in GitHub Desktop.

Select an option

Save glowinthedark/2ec3880982ff1d99a31a514518295c35 to your computer and use it in GitHub Desktop.
uri-percent-encode.sh
printf '%s' "$*" | jq -sRr @uri
printf '%s' "$*" | xxd -p -c1 | sed 's/^/%/' | tr -d '\n'
printf "\npython\n"
python3 -c "import sys; print(''.join(f'%{b:02X}' for b in bytes('$*', 'utf8')))"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment