Properties pro = new Properties();
        pro.setProperty("1","test1");
        pro.setProperty("2","test2");
        pro.setProperty("3","test3");
        try {
            FileOutputStream fos = new FileOutputStream("d:\\obj.txt");
            pro.store(fos, "属性");
            fos.close();
        }
        catch (IOException ex) {
        }

解决方案 »

  1.   

    原来的Properties不支持选择字符集。 
    默认的符集好象是8859_1。
    自己写一个转换
    或写一个支持选择字符集的Properties
      

  2.   

    还好只是开头的注释是乱码,属性已自动转成unicode形式保存了。
      

  3.   

    呵呵,我也遇到这种情况,因为Properties的默认支持的字符集是8859_1。
    你可以把在JAVA源码中找到Properties这个类源码,自己只要把那个8859_1的字符集
    改为GB2312等支持中文的字符集就行了,不过,单独拿出来,有的时候会出错
    你自己改改就行了。
    我在项目中也是把源代码改了,然后就可以用中文