diff options
author | Michael Rennie | 2011-04-04 20:44:58 +0000 |
---|---|---|
committer | Michael Rennie | 2011-04-04 20:44:58 +0000 |
commit | 47c9bec09f0d003febef578e0fbb5eaead31746f (patch) | |
tree | 6c11e620cb479280d3d510009fab26102bba6aa2 | |
parent | 20fa26d07a57ca09f190ca2759d1127c3b292b53 (diff) | |
download | eclipse.platform-R3_5_maintenance.tar.gz eclipse.platform-R3_5_maintenance.tar.xz eclipse.platform-R3_5_maintenance.zip |
Bug 341129 - Bidi3.4: Bidi strings are not displayed properly in Console viewv20110404_r352R3_5_maintenance
3 files changed, 42 insertions, 13 deletions
diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/debug/model/RemoteAntDebugBuildListener.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/debug/model/RemoteAntDebugBuildListener.java index 6ccb55601..7137d46ec 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/debug/model/RemoteAntDebugBuildListener.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/debug/model/RemoteAntDebugBuildListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2006 IBM Corporation and others. + * Copyright (c) 2003, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -69,8 +69,14 @@ public class RemoteAntDebugBuildListener extends RemoteAntBuildListener implemen } } - public RemoteAntDebugBuildListener(ILaunch launch) { - super(launch); + /** + * Constructor + * + * @param launch the backing launch to listen to + * @param encoding the encoding to use for communications + */ + public RemoteAntDebugBuildListener(ILaunch launch, String encoding) { + super(launch, encoding); //fDebug= true; } @@ -130,7 +136,7 @@ public class RemoteAntDebugBuildListener extends RemoteAntBuildListener implemen try { fRequestSocket = new Socket("localhost", fRequestPort); //$NON-NLS-1$ fRequestWriter = new PrintWriter(fRequestSocket.getOutputStream(), true); - fResponseReader = new BufferedReader(new InputStreamReader(fRequestSocket.getInputStream())); + fResponseReader = new BufferedReader(new InputStreamReader(fRequestSocket.getInputStream(), getEncoding())); fReaderThread= new ReaderThread(); fReaderThread.start(); diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntLaunchDelegate.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntLaunchDelegate.java index b7e35e995..4d32173a5 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntLaunchDelegate.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/AntLaunchDelegate.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 IBM Corporation and others. + * Copyright (c) 2000, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -537,14 +537,15 @@ public class AntLaunchDelegate extends LaunchConfigurationDelegate { private void runInSeparateVM(ILaunchConfiguration configuration, ILaunch launch, IProgressMonitor monitor, String idStamp, String antHome, int port, int requestPort, StringBuffer commandLine, boolean captureOutput, boolean setInputHandler) throws CoreException { boolean debug= fMode.equals(ILaunchManager.DEBUG_MODE); + String encoding = DebugPlugin.getDefault().getLaunchManager().getEncoding(configuration); if (captureOutput) { if (debug) { - RemoteAntDebugBuildListener listener= new RemoteAntDebugBuildListener(launch); + RemoteAntDebugBuildListener listener= new RemoteAntDebugBuildListener(launch, encoding); if (requestPort != -1) { listener.startListening(port, requestPort); } } else if (!fUserSpecifiedLogger) { - RemoteAntBuildListener client= new RemoteAntBuildListener(launch); + RemoteAntBuildListener client= new RemoteAntBuildListener(launch, encoding); if (port != -1) { client.startListening(port); } diff --git a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/RemoteAntBuildListener.java b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/RemoteAntBuildListener.java index 61d813618..c4fdb0870 100644 --- a/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/RemoteAntBuildListener.java +++ b/ant/org.eclipse.ant.ui/Ant Tools Support/org/eclipse/ant/internal/ui/launchConfigurations/RemoteAntBuildListener.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2003, 2011 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -72,6 +72,11 @@ public class RemoteAntBuildListener implements ILaunchesListener { private String fLastFileName= null; private String fLastTaskName= null; private boolean fBuildFailed= false; + /** + * The encoding to use + * @since 3.5.2+ + */ + private String fEncoding; /** * Reads the message stream from the RemoteAntBuildLogger @@ -93,7 +98,7 @@ public class RemoteAntBuildListener implements ILaunchesListener { int socketTimeout= prefs.getInt(IAntUIPreferenceConstants.ANT_COMMUNICATION_TIMEOUT); fServerSocket.setSoTimeout(socketTimeout); fSocket= fServerSocket.accept(); - fBufferedReader= new BufferedReader(new InputStreamReader(fSocket.getInputStream(), "UTF-8")); //$NON-NLS-1$ + fBufferedReader= new BufferedReader(new InputStreamReader(fSocket.getInputStream(), fEncoding)); String message; while(fBufferedReader != null && (message= fBufferedReader.readLine()) != null) { receiveMessage(message); @@ -112,12 +117,29 @@ public class RemoteAntBuildListener implements ILaunchesListener { } } - public RemoteAntBuildListener(ILaunch launch) { - super(); - fLaunch= launch; - DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); + /** + * Constructor + * + * @param launch the backing launch to listen to + * @param encoding the encoding to use for communications + */ + public RemoteAntBuildListener(ILaunch launch, String encoding) { + super(); + fLaunch= launch; + fEncoding = encoding; + DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this); } + /** + * Returns the encoding set on the listener + * + * @return the encoding set on the listener + * @since 3.5.2+ + */ + protected String getEncoding() { + return fEncoding; + } + /** * Start listening to an Ant build. Start a server connection that * the RemoteAntBuildLogger can connect to. |