lishunli / nutz

Automatically exported from code.google.com/p/nutz
0 stars 0 forks source link

Disk.absolute(String, ClassLoader, String),当上层文件夹中包含非英文字符时,返回的path可能不正确 #142

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Disk.absolute(String, ClassLoader, 
String),当上层文件夹中包含非英文字符时,
且搜查找的文件需要通过 
ClassLoader.getSystemResource(path)得到的话,返回的
path未decode.

问题产生的条件:
1.新建一个文件夹,命名为"文件夹A"
2. "文件夹A"下放nutz的工程
3. 在该文件夹下运行以下代码:
File f = Castors.me().castTo("org/nutz", File.class);
System.out.println(f.exists());

预期得到 true , 结果得到false

Original issue reported on code.google.com by wendal1985@gmail.com on 25 Mar 2010 at 12:40

GoogleCodeExporter commented 9 years ago
将 return url.getPath();
改为 return normalize(url.getPath(),enc); 

返回前进行url解码.

fix in r972

Original comment by wendal1985@gmail.com on 25 Mar 2010 at 12:44

GoogleCodeExporter commented 9 years ago

Original comment by wendal1985@gmail.com on 25 Mar 2010 at 12:44

GoogleCodeExporter commented 9 years ago
Add JUnit : FilesTest.test_find_file_in_chinese_path() aslo
r976

Original comment by zozoh...@gmail.com on 25 Mar 2010 at 2:39

GoogleCodeExporter commented 9 years ago

Original comment by wendal1985@gmail.com on 13 May 2010 at 11:07