What does "it does not work" mean? That is, what is an example failure case?


Good question.

Because it does work :)
All I can say to my defense is that my library management is a mess!

Therefore I decided to make the simplest possible class for testing
how file.toURI().toString()

It encodes all excluded characters (space, %, #, < ...)
From reserved character it encodes (on my linux) only   ? (question mark)
Then from  unwise characters ({}|\\^[]`) it encodes all.

But maybe it is not necessary to know how it encodes because the
inverse operation can be done too.

new File(new URI(
   (new File("$%&[EMAIL PROTECTED]|\\^[]`$")).toURI().toString()
)).getPath()

Returns $%&[EMAIL PROTECTED]|\\^[]`$
Which is correct.

Once again all this confusion was produced because I have my
library management in state of flux and I have had bad experiences
with this issue in the past.
Also I remembered the bug about this encoding issue but this
really seems to work.

My java -version returns
1.4.2_06-b03

This might not work on 1.3 but I am not sure.
Like I said before, the URI encoding is schema specific,
so it should be done separately for different providers.

And it seems that for local files URI and File classes
could work as the codec.

Thanks binkley!

- rami

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to