-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: uri decode function #3161
Conversation
Hey, i think that makes sense to add. gojq has is already and it seems like jaq used to have it 01mf02/jaq#105 but got removed as jq didn't have it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think it makes sense to add a @urid
since there is also @base64d
; it can be useful.
a56ac41
to
3d844f8
Compare
Should |
it seems like real percent encoding uses |
The |
I think |
looking at the code for If people want i can change the behavior of both |
Played around a bit with how go does it https://go.dev/play/p/Itnr8EfdOjK for the query it seem to decode both For reference this is how gojq behaves atm, uses query behavior in both cases $ gojq -n '"+%20" | @urid'
" "
$ gojq -n '" " | @uri'
"+" |
|
Understood. These formats are for path segments, not for query params. |
@fmgornick Thanks for working on this! 🥳 |
of course! thank you all for providing such constructive feedback 😊 |
hi! i love this tool and have been using it for years, but recently noticed it doesn't have built in uri decoding. i didn't feel like writing a bash script or installing another program for something this trivial, plus i thought it'd be a nice addition to jq, so i thought i'd try adding it!
I didn't add too many tests because i wanted to keep it consistent with the other format strings, but i did personally test a few files in the src dir, and i also tested it on this file containing every unicode point.
closes #798, closes #2261.