I have a photo selection model, but for some reason whenever I call the path of the images, the space in the path is converted to it's HTML code and I'm not sure why. Do any of you have any ideas? Thanks for any help you can spare.
Asked
Active
Viewed 3,108 times
2 Answers
4
It's url encoded. I dont know the java library to un-encode but I'm sure it's out there and fairly easy to use.
edit - http://download.oracle.com/javase/1.4.2/docs/api/java/net/URLDecoder.html
this maybe?

asawyer
- 17,642
- 8
- 59
- 87
-
+1 This has been been bothering me for months. I always used the toURI() method on java URLs to avoid getting url encoded paths, but this is cleaner. – Fil Oct 28 '11 at 14:35
0
The specification for URLs (RFC 1738, Dec. '94) says:
Thus, only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.
And we have:
- Space = decimal code point 32 in the ISO-Latin set.
- 32 decimal = 20 in hexadecimal
- The URL encoded representation will be "%20"

lukastymo
- 26,145
- 14
- 53
- 66