Cet article décrit la méthode de Java à l'aide du format UTF8 pour enregistrer les fichiers texte. Partagez-le pour votre référence, comme suit:
FileOutputStream fos = null; outputStreamWriter writer = null; try {file file = new File (filepath); Ressource));} catch (exception e) {checkxmlutil.adderrormsg (checkxmlutil.text_fomart_error, checkxmlutil.save_xml_fiall, e); } catch (ioException e1) {checkxmlutil.adderrormsg (checkxmlutil.text_fomart_error, checkxmlutil.save_xml_fiall, e1);} if (writer! = null) {tryxmlUl.adderror (); Checkxmlutil.J'espère que cet article sera utile à la programmation Java de tous.