Behaviour of javaws when handling spaces.
omajid at redhat.com
Thu Oct 27 08:11:21 PDT 2011
On 10/27/2011 10:25 AM, Pavel Tisnovsky wrote:
> Jiri Vanek wrote:
>> I'm trying to provide test to latest Omair's patch to PR804.
>> Patch itself is not ready (I'm posting it just for clarifications),
>> because I hesitated how javaws should handle "Spaced" files.
Thanks for bringing this up.
>> Omair's patch fixed state, when locally lunched file with spaces was
>> handled incorrectly. But question is, how is this file obtained from
>> server? I believe that in URL which downloads this file should (eg)
>> spaces replaced by %20 (and so on), but file should be saved (eg into
>> cache or for next usage) correctly. If So, how the hrefs inside jnlp
>> should be written? With spaces or with "%20"? If there are Spaces then
>> it is working on local lunching, and %20 are working on remote lunching,
>> but not vice versa.
>> In my reproducer all those cases are covered (local x remote and jnlp
>> with spaces x jar with spaces). But all of the cases except one (jnlp
>> with spaces, jar without spaces) are failing.
>> Some changes to engine were necessary - handling of spaces in makefile,
>> and correct(?) translating URI<-> String insinde tiny http server.
>> Any remarks tto patch and to correct space handling welcomed.
> Hi Jiri,
> from my point of view, the percent encoding should be used only during requesting (possibly distant) file, ie in
> URL/URI, but on the other hand the file name must contains spaces, not %20s. Also please note, that not only space is
> encoded by percent encoding: http://en.wikipedia.org/wiki/Percent-encoding.
I agree that local file names should be handled as they are. If a file
name is 'my jnlp.jnlp' then it should be accepted. I also agree that
remote urls should be encoded - browsers like firefox will let me type
in 'http://localhost/my jnlp.jnlp' but will encode it behind the scenes
and fetch 'my%20jnlp.jnlp' instead.
What I think would be best is if we could handle urls/paths with and
without spaces (and other special characters) and encode them (if
necessary) when dealing with actual (non file://) urls. This will allow
a user to say javaws 'file with space.jnlp' which should work. It will
also work if the file itself contains a href such as 'file with space.jnlp'.
More information about the distro-pkg-dev