1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-08 08:45:44 +02:00

[248339] [dnd][encodings] Cannot drag&drop / copy&paste files or folders with turkish or arabic names

This commit is contained in:
David McKnight 2008-09-29 22:10:03 +00:00
parent 8027ada71a
commit 361660397b
2 changed files with 23 additions and 2 deletions

View file

@ -16,9 +16,11 @@
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* David McKnight (IBM) - [223103] [cleanup] fix broken externalized strings
* David McKnight (IBM) - [248339] [dnd][encodings] Cannot drag&drop / copy&paste files or folders with turkish or arabic names
*******************************************************************************/
package org.eclipse.rse.ui.actions;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Iterator;
@ -222,7 +224,14 @@ public class SystemCopyToClipboardAction extends SystemBaseAction implements IV
}
}
PluginTransferData data = new PluginTransferData(SystemDropActionDelegate.ID, dataStream.toString().getBytes());
byte[] bytes = null;
try {
bytes = dataStream.toString().getBytes("UTF-8"); //$NON-NLS-1$
}
catch (UnsupportedEncodingException e){
bytes = dataStream.toString().getBytes();
}
PluginTransferData data = new PluginTransferData(SystemDropActionDelegate.ID, bytes);
// put data in clipboard
if (_doResourceTransfer && resources.size() > 0)

View file

@ -18,9 +18,11 @@
* Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core
* Martin Oberhuber (Wind River) - [] Move SystemRegistry impl into Core
* Martin Oberhuber (Wind River) - [215820] Move SystemRegistry implementation to Core
* David McKnight (IBM) - [248339] [dnd][encodings] Cannot drag&drop / copy&paste files or folders with turkish or arabic names
********************************************************************************/
package org.eclipse.rse.ui.internal.model;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
@ -376,9 +378,19 @@ public class SystemRegistryUI implements ISystemRegistryUI {
// RSE transfer
PluginTransferData data = (PluginTransferData) object;
byte[] result = data.getData();
// get the sources
String str = null;
try {
str = new String(result, "UTF-8"); //$NON-NLS-1$
}
catch (UnsupportedEncodingException e)
{
str = new String(result);
}
//StringTokenizer tokenizer = new StringTokenizer(new String(result), SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
String[] tokens = (new String(result)).split("\\"+SystemViewDataDropAdapter.RESOURCE_SEPARATOR); //$NON-NLS-1$
String[] tokens = str.split("\\"+SystemViewDataDropAdapter.RESOURCE_SEPARATOR); //$NON-NLS-1$
for (int i = 0;i < tokens.length; i++)
{