We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fa7a9f8 commit 39a1f5fCopy full SHA for 39a1f5f
1 file changed
src/matlabcontrol/Configuration.java
@@ -10,6 +10,7 @@
10
import java.lang.reflect.Method;
11
import java.net.URISyntaxException;
12
import java.net.URL;
13
+import java.net.URLEncoder;
14
import java.security.CodeSource;
15
import java.security.ProtectionDomain;
16
@@ -203,7 +204,9 @@ static String getSupportCodeLocation() throws MatlabConnectionException {
203
204
if (url != null) {
205
//Convert from url to absolute path
206
try {
- File file = new File(url.toURI()).getCanonicalFile();
207
+ // make sure that the url is properly encoded
208
+ URL encoded = new URL(URLEncoder.encode(url.toString(), "UTF-8"));
209
+ File file = new File(encoded.toURI()).getCanonicalFile();
210
if (file.exists()) {
211
return file.getAbsolutePath();
212
} else {
0 commit comments