From 19716c0ca7df2cf4100ba0ba834fbd69a4a6b50a Mon Sep 17 00:00:00 2001 From: Uwe Stieber Date: Fri, 20 Feb 2015 10:09:47 +0100 Subject: [PATCH] Terminal: Fix Bug 448144 - accent characters do not work correctly Encode the byte to send for the currently selected encoding before sending it to the terminal. Change-Id: I0ed295163c6e5dd2fde19b8b562d76a8d775a78b --- .../terminal/emulator/VT100TerminalControl.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java index dcf15b6b77c..5e3603c44b8 100644 --- a/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java +++ b/terminal/plugins/org.eclipse.tm.terminal/src/org/eclipse/tm/internal/terminal/emulator/VT100TerminalControl.java @@ -578,12 +578,19 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC // // TODO: Make the ESCAPE-vs-highbit behavior user configurable. - Logger.log("sending ESC + '" + byteToSend + "'"); //$NON-NLS-1$ //$NON-NLS-2$ + byte[] bytesToSend = String.valueOf(chKey).getBytes(fEncoding); + Logger.log("sending ESC "); //$NON-NLS-1$ + for (int i = 0; i < bytesToSend.length; i++) { + Logger.log("+ '" + bytesToSend[i] + "'"); //$NON-NLS-1$ //$NON-NLS-2$ + } os.write('\u001b'); - os.write(byteToSend); + os.write(bytesToSend); } else { - Logger.log("sending '" + byteToSend + "'"); //$NON-NLS-1$ //$NON-NLS-2$ - os.write(byteToSend); + byte[] bytesToSend = String.valueOf(chKey).getBytes(fEncoding); + for (int i = 0; i < bytesToSend.length; i++) { + Logger.log("sending '" + bytesToSend[i] + "'"); //$NON-NLS-1$ //$NON-NLS-2$ + } + os.write(bytesToSend); } os.flush(); }