part of EDU-294
authorLiana Bakradze <liana.bakradze@jetbrains.com>
Mon, 15 Dec 2014 14:17:54 +0000 (17:17 +0300)
committerLiana Bakradze <liana.bakradze@jetbrains.com>
Mon, 15 Dec 2014 14:17:54 +0000 (17:17 +0300)
python/edu/learn-python/src/com/jetbrains/python/edu/actions/StudyRefreshTaskFileAction.java

index 1a15afdf70132a4ba964ae823370718c6f599d84..c956d3cf165dd58b781c71ae1ea6f5d513b811b6 100644 (file)
@@ -119,7 +119,7 @@ public class StudyRefreshTaskFileAction extends DumbAwareAction {
       File resourceFile = new File(course.getResourcePath());
       File resourceRoot = resourceFile.getParentFile();
       File pattern = new File(new File(new File(resourceRoot, lessonDir), taskDir), fileName);
-      reader = new BufferedReader(new InputStreamReader(new FileInputStream(pattern)));
+      reader = new BufferedReader(new InputStreamReader(new FileInputStream(pattern), "UTF-8"));
       String line;
       StringBuilder patternText = new StringBuilder();
       while ((line = reader.readLine()) != null) {
@@ -131,7 +131,7 @@ public class StudyRefreshTaskFileAction extends DumbAwareAction {
         if (patternText.charAt(patternLength - 1) == '\n') {
           patternText.delete(patternLength - 1, patternLength);
         }
-        document.setText(patternText);
+        document.setText(new String(patternText.toString().getBytes("UTF-8")));
       }
     }
     catch (FileNotFoundException e) {