1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-21 07:05:58 +02:00

[210812] for text transfer, need to tell editor to use local encoding

This commit is contained in:
David McKnight 2007-11-23 20:57:16 +00:00
parent 773d10b1d9
commit 02e91e10d7

View file

@ -22,6 +22,7 @@
* Kevin Doyle (IBM) - [197976] Changing a file to read-only when it is open doesn't update local copy * 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) - [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; package org.eclipse.rse.files.ui.resources;
@ -1482,11 +1483,18 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
{ {
if (encoding != null) if (encoding != null)
{ {
if (remoteFile.isBinary()){
if (!file.getCharset().equals(encoding)) if (!file.getCharset().equals(encoding))
{ {
file.setCharset(encoding, null); 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);
}
}
} }
catch (Exception e) catch (Exception e)
{ {