diff --git a/src/main/java/es/kauron/jstudy/model/TestItem.java b/src/main/java/es/kauron/jstudy/model/TestItem.java index 88fa56f..0a2a53d 100644 --- a/src/main/java/es/kauron/jstudy/model/TestItem.java +++ b/src/main/java/es/kauron/jstudy/model/TestItem.java @@ -4,6 +4,7 @@ import javafx.beans.property.SimpleStringProperty; import javafx.beans.property.StringProperty; import java.io.*; +import java.nio.charset.Charset; import java.util.ArrayList; import java.util.InputMismatchException; import java.util.List; @@ -53,7 +54,8 @@ public class TestItem { public static void saveTo(File file, List data) { try { - OutputStreamWriter writer = new FileWriter(file); + OutputStreamWriter writer = new OutputStreamWriter( + new FileOutputStream(file), Charset.forName("UTF-8").newEncoder()); for (TestItem item : data) { writer.write(item.getQuestion() + "::" + item.getAnswer() + "\n"); }