如何用JAVA输出一个UTF8编码的文本文件

            FileOutputStream fos = new FileOutputStream("test.txt");
            Writer out = new OutputStreamWriter(fos, "utf-8");
            out.write(contentString);
            out.close();
            fos.close();

你可能感兴趣的:(java)