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

Fix file path decoding #4426

Merged
merged 1 commit into from May 1, 2016

Conversation

Projects
None yet
2 participants
@JakubValtar
Contributor

JakubValtar commented Apr 24, 2016

URLDecoder was being used for path decoding, even though it can't handle
RFC2396 encoding. This resulted in plus characters being removed and
possibly other weirdness.

See https://docs.oracle.com/javase/8/docs/api/java/net/URL.html

The recommended way to manage the encoding and decoding of URLs is to use URI, and to convert between these two classes using toURI() and URI.toURL(). The URLEncoder and URLDecoder classes can also be used, but only for HTML form encoding, which is not the same as the encoding scheme defined in RFC2396.

Fixes #4417

Fix file path decoding
URLDecoder was being used for path decoding, even though it can't handle
RFC2396 encoding. This resulted in plus characters being removed and
possibly other weirdness.

See https://docs.oracle.com/javase/8/docs/api/java/net/URL.html
"The recommended way to manage the encoding and decoding of URLs is to
use URI, and to convert between these two classes using toURI() and
URI.toURL(). The URLEncoder and URLDecoder classes can also be used, but
only for HTML form encoding, which is not the same as the encoding
scheme defined in RFC2396."

Fixes #4417

@benfry benfry merged commit 9424dc7 into processing:master May 1, 2016

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry May 1, 2016

Member

Ok, I'll need to test this on OS X since that's why the decoding is in there in the first place.

Member

benfry commented May 1, 2016

Ok, I'll need to test this on OS X since that's why the decoding is in there in the first place.

@JakubValtar

This comment has been minimized.

Show comment
Hide comment
@JakubValtar

JakubValtar May 1, 2016

Contributor

This is how encoding should be handled according to Java documentation, so I presume it's going to work alright. In any case, URLDecoder is not the right tool for the job.

Contributor

JakubValtar commented May 1, 2016

This is how encoding should be handled according to Java documentation, so I presume it's going to work alright. In any case, URLDecoder is not the right tool for the job.

@JakubValtar JakubValtar deleted the JakubValtar:bugfix-paths branch May 7, 2016

@benfry benfry referenced this pull request May 7, 2016

Closed

Processing not starting up. #4438

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment