From 02e91e10d71d993a19332060424755cb92455ce8 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Fri, 23 Nov 2007 20:57:16 +0000 Subject: [PATCH] [210812] for text transfer, need to tell editor to use local encoding --- .../ui/resources/SystemEditableRemoteFile.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java index 4226cc1cdab..2d4ee47ee3a 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemEditableRemoteFile.java @@ -21,7 +21,8 @@ * David McKnight (IBM) - [187130] New Folder/File, Move and Rename should be available for read-only folders * Kevin Doyle (IBM) - [197976] Changing a file to read-only when it is open doesn't update local copy * David McKnight (IBM) - [186363] get rid of obsolete calls to ISubSystem.connect() - * David McKnight (IBM) -[209660] check for changed encoding before using cached file + * David McKnight (IBM) - [209660] check for changed encoding before using cached file + * David McKnight (IBM) - [210812] for text transfer, need to tell editor to use local encoding ********************************************************************************/ package org.eclipse.rse.files.ui.resources; @@ -1482,9 +1483,16 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP { if (encoding != null) { - if (!file.getCharset().equals(encoding)) - { - file.setCharset(encoding, null); + if (remoteFile.isBinary()){ + if (!file.getCharset().equals(encoding)) + { + file.setCharset(encoding, null); + } + } + else { + // using text mode so the char set needs to be local + String localEncoding = System.getProperty("file.encoding"); + file.setCharset(localEncoding, null); } } }