java text save

in #java7 years ago

// save text utf-8

public static boolean txtSave(String fnm, String text) {
    Writer out = null;
    try {
        out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(fnm), "UTF-8"));
        out.write(text);
        return true;
    } catch (IOException e) {
        return false;
    } finally {
        closeQuietly(out);
    }
}