From 2a18d44c77f344b4bfba372af66ffd2f71928333 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Wed, 11 Jul 2007 18:39:02 +0000 Subject: [PATCH] [191599] use shell encoding specified --- .../eclipse/rse/dstore/universal/miners/CommandMiner.java | 8 +++++++- .../servicesubsystem/ShellServiceSubSystem.java | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/CommandMiner.java b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/CommandMiner.java index d6034c661c7..6b342263e2c 100644 --- a/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/CommandMiner.java +++ b/rse/plugins/org.eclipse.rse.services.dstore/miners/org/eclipse/rse/dstore/universal/miners/CommandMiner.java @@ -12,7 +12,7 @@ * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * * Contributors: - * {Name} (company) - description of contribution. + * David McKnight (IBM) - [191599] use specified encoding for shell *******************************************************************************/ package org.eclipse.rse.dstore.universal.miners; @@ -189,6 +189,12 @@ public class CommandMiner extends Miner else if (name.equals("C_SHELL")) //$NON-NLS-1$ { String invocation = ">"; //$NON-NLS-1$ + DataElement encodingArg = getCommandArgument(theElement, 1); + if (encodingArg.getType().equals("shell.encoding")) + { + // fix for 191599 + System.setProperty("dstore.stdin.encoding",encodingArg.getValue()); //$NON-NLS-1$ //$NON-NLS-2$ + } launchCommand(subject, invocation, status); } else if (name.equals("C_SEND_INPUT")) //$NON-NLS-1$ diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java index 9020b5e530f..8710b793ee8 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java @@ -14,6 +14,7 @@ * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() + * David McKnight (IBM) - [191599] Need to pass in shell encoding ********************************************************************************/ package org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem; @@ -141,7 +142,8 @@ public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements I IShellService service = getShellService(); - IHostShell hostShell = service.launchShell(cwd, getUserAndHostEnvVarsAsStringArray(), monitor); + String encoding = getHost().getDefaultEncoding(true); + IHostShell hostShell = service.launchShell(cwd, encoding, getUserAndHostEnvVarsAsStringArray(), monitor); IServiceCommandShell cmdShell = createRemoteCommandShell(this, hostShell); if (cmdShell != null) {