在java中,包含空格的文件路径显示为%20,我不确定为什么 [英] in java my file paths with included spaces show up as %20 and i'm not sure why

查看:214
本文介绍了在java中,包含空格的文件路径显示为%20,我不确定为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个照片选择模型,但是由于某种原因,每当我调用图像的路径时,路径中的空间都会转换为HTML代码,我不确定为什么.你们有什么想法吗?感谢您的宝贵帮助.

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.

推荐答案

它是url编码的.我不知道要取消编码的Java库,但我确定它已经存在并且相当容易使用.

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.

编辑- http://下载. oracle.com/javase/1.4.2/docs/api/java/net/URLDecoder.html

这也许吗?

这篇关于在java中,包含空格的文件路径显示为%20,我不确定为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆