mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-18 22:45:23 +02:00
[365780] [dstore] codepage conversion should only occur for different encodings
This commit is contained in:
parent
a0429d8147
commit
2f4cea89e5
1 changed files with 45 additions and 39 deletions
|
@ -64,6 +64,7 @@
|
|||
* David McKnight (IBM) - [298440] jar files in a directory can't be pasted to another system properly
|
||||
* David McKnight (IBM) - [308770] [dstore] Remote Search using old server fails with NPE
|
||||
* David McKnight (IBM) - [339548] [dstore] shouldn't attempt file conversion on empty files
|
||||
* David McKnight (IBM) - [365780] [dstore] codepage conversion should only occur for different encodings
|
||||
*******************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.services.dstore.files;
|
||||
|
@ -842,6 +843,8 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
if (!isBinary && fileLength > 0){ // do standard conversion if this is text!
|
||||
String localEncoding = SystemEncodingUtil.getInstance().getLocalDefaultEncoding();
|
||||
|
||||
if (!localEncoding.equals(encoding)) {// only do conversion if the encodings are different and the length is non-zero
|
||||
|
||||
IFileServiceCodePageConverter codePageConverter = CodePageConverterManager.getCodePageConverter(encoding, this);
|
||||
|
||||
try {
|
||||
|
@ -865,6 +868,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION))
|
||||
{
|
||||
localFile.delete();
|
||||
|
@ -1092,6 +1096,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
// do standard conversion if this is text!
|
||||
if (!isBinaries[j] && fileLength > 0){ // do standard conversion if this is text! or if the file is empty
|
||||
String localEncoding = SystemEncodingUtil.getInstance().getLocalDefaultEncoding();
|
||||
if (!localEncoding.equals(hostEncodings[j])){
|
||||
IFileServiceCodePageConverter codePageConverter = CodePageConverterManager.getCodePageConverter(hostEncodings[j], this);
|
||||
|
||||
try {
|
||||
|
@ -1115,6 +1120,7 @@ public class DStoreFileService extends AbstractDStoreService implements IFileSer
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (resultChild.getType().equals(IUniversalDataStoreConstants.DOWNLOAD_RESULT_FILE_NOT_FOUND_EXCEPTION))
|
||||
{
|
||||
localFile.delete();
|
||||
|
|
Loading…
Add table
Reference in a new issue