in java my file paths with included spaces show up as %20 and i'm not sure why
I have a photo sel开发者_如何学JAVAection 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.
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?
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"
精彩评论