As mentioned by several users both on the Forum and into the Tracker it seems that files/URLs that contain empty spaces in their full path do not open on MAC OS platforms. It there a solution for this?
It seems that the problem comes from Mac platform and not from BrowserLauncher2 library. We need to replace spaces with %20 for the file URL otherwise the Mac doesn't like to open it. We can't just use URLEncoder, since that turns slashes into %2F characters, which is no good.
The following code should be however integrated into BrowserLauncher2 so that developers do not be forced to use it each time they need to open an URL. Here is the code (I hope someone is willing to add it in BrowserLauncher2...):
if (url.indexOf(' ') != -1) {
StringBuffer sb = new StringBuffer();
char c[] = url.toCharArray();
for (int i = 0; i < c.length; i++) {
if (c[i] == ' ') {
sb.append("%20");
} else {
sb.append(c[i]);
}
}
url = sb.toString();
}
Thanks,
Tibi
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It seems that the problem comes from Mac platform and not from BrowserLauncher2 library. We need to replace spaces with %20 for the file URL otherwise the Mac doesn't like to open it. We can't just use URLEncoder, since that turns slashes into %2F characters, which is no good.
The following code should be however integrated into BrowserLauncher2 so that developers do not be forced to use it each time they need to open an URL. Here is the code (I hope someone is willing to add it in BrowserLauncher2...):
if (url.indexOf(' ') != -1) {
StringBuffer sb = new StringBuffer();
char c[] = url.toCharArray();
for (int i = 0; i < c.length; i++) {
if (c[i] == ' ') {
sb.append("%20");
} else {
sb.append(c[i]);
}
}
url = sb.toString();
}
Thanks,
Tibi