diff options
author | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2012-07-24 15:32:30 -0400 |
---|---|---|
committer | Carolyn MacLeod <Carolyn_MacLeod@ca.ibm.com> | 2012-07-24 15:33:02 -0400 |
commit | de6fbaaec46412d3fdef0c01810182c0b01cafbd (patch) | |
tree | b02b3742015a4c77a2bb426a1878a3e1609556e6 | |
parent | 27680729acd44e890a7f12853debc377384d8bbf (diff) | |
download | eclipse.platform.swt-de6fbaaec46412d3fdef0c01810182c0b01cafbd.tar.gz eclipse.platform.swt-de6fbaaec46412d3fdef0c01810182c0b01cafbd.tar.xz eclipse.platform.swt-de6fbaaec46412d3fdef0c01810182c0b01cafbd.zip |
Bug 384381 - HTMLTransfer uses UTF-16 to copy to clipboard (should use
UTF-8 to be compatible with paste)
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/HTMLTransfer.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/HTMLTransfer.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/HTMLTransfer.java index d91873d56c..cd7465f614 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/HTMLTransfer.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/gtk/org/eclipse/swt/dnd/HTMLTransfer.java @@ -10,6 +10,7 @@ *******************************************************************************/ package org.eclipse.swt.dnd; +import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.gtk.*; /** @@ -61,13 +62,11 @@ public void javaToNative (Object object, TransferData transferData){ DND.error(DND.ERROR_INVALID_DATA); } String string = (String)object; - int charCount = string.length(); - char [] chars = new char[charCount +1]; - string.getChars(0, charCount , chars, 0); - int byteCount = chars.length*2; + byte[] utf8 = Converter.wcsToMbcs(null, string, true); + int byteCount = utf8.length; int /*long*/ pValue = OS.g_malloc(byteCount); if (pValue == 0) return; - OS.memmove(pValue, chars, byteCount); + OS.memmove(pValue, utf8, byteCount); transferData.length = byteCount; transferData.format = 8; transferData.pValue = pValue; |