这样用:native2ascii -encoding GBK old.properties new.properties 

解决方案 »

  1.   

    仍然提示
    new.properties can not be written
      

  2.   

    for (Enumeration e = p.propertyNames(); e.hasMoreElements();) {
                String property = (String) e.nextElement();
                String value = p.getProperty(property);
                //将 ISO-8859-1 编码转为 GBK 编码
                try {
                    property = new String(property.getBytes("ISO-8859-1"), "GBK");
                    value = new String(value.getBytes("ISO-8859-1"), "GBK");
                } catch (UnsupportedEncodingException ex) {
                    ex.printStackTrace();
                    Config.print(ex.toString());
                    return null;
                }
            }