Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Barnes2006-06-09 11:53:43 -0400
committerKevin Barnes2006-06-09 11:53:43 -0400
commit0df6d916bfab4a3d528a784ea0ab8f09a4020364 (patch)
tree3aad5094c78bdba0b0e9ae6ef71de054eda3a5b3 /org.eclipse.ui.console
parent49759c906c6784b1b887965468130a52d7c4bcb9 (diff)
downloadeclipse.platform.debug-0df6d916bfab4a3d528a784ea0ab8f09a4020364.tar.gz
eclipse.platform.debug-0df6d916bfab4a3d528a784ea0ab8f09a4020364.tar.xz
eclipse.platform.debug-0df6d916bfab4a3d528a784ea0ab8f09a4020364.zip
Bug 145076 - [console] Run configuration with UTF-8 console attached ...
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java4
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java13
2 files changed, 16 insertions, 1 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java
index bd50eee54..72755598f 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsole.java
@@ -251,4 +251,8 @@ public class IOConsole extends TextConsole {
}
inputStream = null;
}
+
+ public String getEncoding() {
+ return fEncoding;
+ }
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
index d92efc1d1..2b04c92e2 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/IOConsoleInputStream.java
@@ -12,6 +12,7 @@ package org.eclipse.ui.console;
import java.io.IOException;
import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
@@ -156,7 +157,17 @@ public class IOConsoleInputStream extends InputStream {
* @param text the text to append to the buffer.
*/
public synchronized void appendData(String text) {
- byte[] newData = text.getBytes();
+ String encoding = console.getEncoding();
+ byte[] newData;
+ if (encoding!=null)
+ try {
+ newData = text.getBytes(encoding);
+ } catch (UnsupportedEncodingException e) {
+ newData = text.getBytes();
+ }
+ else
+ newData = text.getBytes();
+
while(input.length-size < newData.length) {
growArray();
}

Back to the top