Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
HierarchicalUriComponents.encodeUriComponent() method can not encode Pchar [SPR-17621] #22153
I have a question about HierarchicalUriComponents.encodeUriComponent() method. I think it should encode all special char in url query param, Actually, It can not encode many special char. For example + - ! $ ... in url query param. and my email is [email@example.com|mailto:firstname.lastname@example.org] .
Brian Clozel commented
Did you take a loot at the RFC that's referenced from the implementation here?
The RFC 3986 states that the following characters are allowed in a query string (see the appendix A in the ABNF):
This means that sub-delimiters are allowed in query strings and do not need to be percent encoded (that includes
Now I understand that some legal characters might still have a special meaning. We've applied some changes to be more consistent with the encoding of URLs (see #21399), and I think you're ultimately after what was addressed in #21577 (see the dedicated section in the reference documentation).