Skip to content

fix encoding of non-ascii characters - #153

Closed
matt-phylum wants to merge 2 commits into
package-url:masterfrom
matt-phylum:patch-1
Closed

fix encoding of non-ascii characters#153
matt-phylum wants to merge 2 commits into
package-url:masterfrom
matt-phylum:patch-1

Conversation

@matt-phylum

Copy link
Copy Markdown

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

@matt-phylum

Copy link
Copy Markdown
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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-url#154
@dwalluckdwalluck mentioned this pull request Feb 20, 2025
@jeremylong

Copy link
Copy Markdown
Collaborator

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

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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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.
Fixespackage-url#150Closespackage-url#153Fixespackage-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#150Closes#153Fixes#154
Sign up for freeto 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

@matt-phylum@jeremylong