Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

@uri is not percent-encoding all reserved characters #1506

Closed
dhawal55 opened this issue Oct 15, 2017 · 2 comments · Fixed by #2157
Closed

@uri is not percent-encoding all reserved characters #1506

dhawal55 opened this issue Oct 15, 2017 · 2 comments · Fixed by #2157
Labels
Milestone

Comments

@dhawal55
Copy link

dhawal55 commented Oct 15, 2017

@uri documentation in manual:
Applies percent-encoding, by mapping all reserved URI characters to a %XX sequence.

However, it does not percent-encode certain reserved characters like ! ( ) *.

echo '"!()*#$&+,/:;=?@[]"' | jq -r '@uri' 
!()*%23%24%26%2B%2C%2F%3A%3B%3D%3F%40%5B%5D
@dubiouscript
Copy link

see also
whatwg/url#369 "Need an "unreserved" character set (and better define how to percent-encode arbitrary strings)"

@pkoppstein
Copy link
Contributor

pkoppstein commented Jul 13, 2021

The single quote ' is also reserved but not encoded by @uri.

Using the test string at https://developers.google.com/maps/documentation/urls/url-encoding --

$ jqMaster --version
jq-1.6-129-g80052e5-dirty

$ jqMaster -n $'"! * \' ( ) ; : @ & = + $ , / ? % # [ ]" | @uri'
"!%20*%20'%20(%20)%20%3B%20%3A%20%40%20%26%20%3D%20%2B%20%24%20%2C%20%2F%20%3F%20%25%20%23%20%5B%20%5D"

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants