Take encoding from settings
authorDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Wed, 1 Feb 2017 14:23:54 +0000 (15:23 +0100)
committerDmitry Trofimov <dmitry.trofimov@jetbrains.com>
Wed, 1 Feb 2017 14:24:59 +0000 (15:24 +0100)
platform/platform-impl/src/com/intellij/terminal/TerminalExecutionConsole.java

index ad7527a050c13c911411e367a68f9c7330897f9c..ac6c1ede6496cca32c46e540705557dda0be57e4 100644 (file)
@@ -24,6 +24,7 @@ import com.intellij.execution.ui.ConsoleViewContentType;
 import com.intellij.execution.ui.ExecutionConsole;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.Key;
+import com.intellij.openapi.vfs.encoding.EncodingProjectManager;
 import com.jediterm.terminal.TerminalStarter;
 import com.jediterm.terminal.TtyConnector;
 import com.jediterm.terminal.model.HyperlinkFilter;
@@ -35,7 +36,6 @@ import org.jetbrains.annotations.NotNull;
 import javax.swing.*;
 import java.awt.*;
 import java.io.IOException;
-import java.nio.charset.Charset;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -58,7 +58,7 @@ public class TerminalExecutionConsole implements ExecutionConsole {
     };
 
     TerminalSession session = myTerminalWidget
-      .createTerminalSession(new ProcessHandlerTtyConnector(processHandler, Charset.forName("UTF-8"))); //TODO: take charset from settings
+      .createTerminalSession(new ProcessHandlerTtyConnector(processHandler, EncodingProjectManager.getInstance(project).getDefaultCharset()));
 
     processHandler.addProcessListener(new ProcessAdapter() {
       @Override