如题:android 在SD卡上 创建 中文文件名 乱码

解决方案 »

  1.   

    File file=new File(Environment.getExternalStorageDirectory().getPath()+File.separator+"我爱你.txt");
    file.createNewFile();这样能创建成功啊!
    如果你的文件名是网上读取的!那才需要转换!android编码是utf-8的
    如gb2312转换utf-8
    byte[] data;//数据为gb2312
    String strGB=new String(data,"gb2312");
    String strUTF=new String(str.getBytes(),"utf-8");楼主试试吧!
      

  2.   

    你在哪儿看到的乱码???
    Window下的cmd吗?
    如果是的话,请查看以下链接:
    [Android]解决Window系统adb shell后中文显示乱码
    http://blog.csdn.net/sodino/archive/2010/12/06/6058032.aspx
      

  3.   

    问题的分歧在于:
    windows下中文一般是gbk或者gb2312编码
    但是android是Linux内核,默认中文为 utf-8编码。