diff --git a/terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/streams/InputStreamMonitor.java b/terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/streams/InputStreamMonitor.java index 3713ee36b62..4ec791360bb 100644 --- a/terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/streams/InputStreamMonitor.java +++ b/terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/streams/InputStreamMonitor.java @@ -339,11 +339,8 @@ public class InputStreamMonitor extends OutputStream implements IDisposable { Assert.isNotNull(bytes); if (replacement != NO_CHANGE && len > 0) { - String origText = new String(bytes, off, len); + String origText = new String(bytes, off, len, terminalControl.getCharset()); String text = null; - // - // TODO: check whether this is correct! new String(byte[], int, int) always uses the default - // encoding! if (replacement == CHANGE_CR_TO_LF) { text = origText.replace('\r', '\n'); @@ -356,7 +353,7 @@ public class InputStreamMonitor extends OutputStream implements IDisposable { } if (text != null && !origText.equals(text)) { - bytes = text.getBytes(); + bytes = text.getBytes(terminalControl.getCharset()); } } diff --git a/terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/streams/OutputStreamMonitor.java b/terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/streams/OutputStreamMonitor.java index 23621600969..36848d49620 100644 --- a/terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/streams/OutputStreamMonitor.java +++ b/terminal/plugins/org.eclipse.tm.terminal.view.ui/src/org/eclipse/tm/terminal/view/ui/streams/OutputStreamMonitor.java @@ -274,8 +274,7 @@ public class OutputStreamMonitor implements IDisposable { // Remember if the text got changed. boolean changed = false; - // How can me make sure that we don't mess with the encoding here? - String text = new String(byteBuffer, 0, bytesRead); + String text = new String(byteBuffer, 0, bytesRead, terminalControl.getCharset()); // Shift-In (14) and Shift-Out(15) confuses the terminal widget if (text.indexOf(14) != -1 || text.indexOf(15) != -1) { @@ -312,7 +311,7 @@ public class OutputStreamMonitor implements IDisposable { // If changed, get the new bytes array if (changed) { - byteBuffer = text.getBytes(); + byteBuffer = text.getBytes(terminalControl.getCharset()); bytesRead = byteBuffer.length; }