当前位置: 代码迷 >> Android >> 关于File 中文文件名
  详细解决方案

关于File 中文文件名

热度:77   发布时间:2016-05-01 21:35:07.0
【急】关于File 中文文件名
本人先在 终端设备的 /mnt/flash/aa/你好/啊啊 创建好了文件夹,
代码里面
String filepath = "/mnt/flash/aa/你好/啊啊/";
File f=new File(filepath);  
if (f.exists()) {
  System.out.println(f+ " is existed.");
} else {
  System.out.println(f+ " not is existed");
  f.mkdirs();  
}

运行后log 显示" not is existed ",而重新 创建了 乱码的文件目录。

这是什么原因呢?希望高手指点,谢谢!

------解决方案--------------------
编码
 回复内容太短了!
------解决方案--------------------
中文要考虑编码的问题啊
------解决方案--------------------
楼上都是正解,编码问题,中文的还是用string引用吧
android编码规范是代码中不要有中文的
  相关解决方案