Skip to content

Conversation

@matt-phylum
Copy link

Java uses only signed values, so casting a byte to an int sign extends it, resulting in incorrect percent encoding.

@matt-phylum
Copy link
Author

This should also fix #150, which relates to values less than 0x10, as well as the problem with values greater than 0x7f that I originally noticed.

dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Feb 20, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Feb 20, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Feb 20, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Feb 20, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Feb 20, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Feb 20, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Feb 20, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
@jeremylong
Copy link
Collaborator

Thanks for the PR. However, I believe this will be covered by #160.

@jeremylong jeremylong closed this Mar 9, 2025
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 10, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 11, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 12, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 13, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
dwalluck added a commit to dwalluck/packageurl-java that referenced this pull request Mar 14, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes package-url#150
Closes package-url#153
Fixes package-url#154
jeremylong pushed a commit that referenced this pull request Mar 16, 2025
The methods `uriEncode` and `uriDecode` did not properly handle
percent-encoding. In particular, `uriEncode` didn't properly output two
uppercase hex digits and `urlDecode` did not properly handle non-ASCII
characters.

Aditionally, if no percent-encoding was performed, these methods will
now return the original string.

Fixes #150
Closes #153
Fixes #154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants