JDK-4313838 : Win&Sol Japanese:DnD from native app doesn't work with selectBestTextFlavor
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2000-02-18
  • Updated: 2000-12-19
  • Resolved: 2000-11-28
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
On solaris & win32
DnD from native application or TextArea(on Solaris only) does not work well
with DataFlavor.selectBestTextFlavor.


On Solaris:
DnD of alphabetical and numeric characters can work.
DnD of Japanese characters can not and Exception is thrown in getReaderForText;

 java.io.IOException: class java.io.IOException:no native data was transferred caught while getting Data
at java.awt.dnd.DropTargetContext$TransferableProxy.getTransferData(DropTargetContext.java:344)
at java.awt.datatransfer.DataFlavor.getReaderForText(DataFlavor.java:493)
at DragDropTest$Target.drop(DragDropTest.java:89)

DataFlavor returned by DataFlavor.selectBestTextFlavor is;
MIMEType=text/plain; class=java.io.InputStream; charset=iso8859-1
"iso8859-1" can not treat 2byte characters.

DataFlavors returned by DropTargetDropEvent is;
MIMEType[0]=text/plain; class=java.io.InputStream; charset=unknown
MIMEType[1]=text/plain; class=java.io.InputStream; charset=X11-COMPOUND_TEXT
MIMEType[2]=text/plain; class=java.io.InputStream; charset=iso8859-1


On Win98:
DnD of alphabetical and numeric characters can work.
DnD of Japanese characters can not work;
Characters can not be displayed correctly
(Japanese character is displayed as "?")
DataFlavor returned by DataFlavor.selectBestTextFlavor is;
MIMEType=text/plain; class=java.io.InputStream; charset=ascii


On Win95&NT:
DnD of alphabetical and numeric characters CANNOT work.
DnD of Japanese characters can not work;
Characters can not be displayed correctly (displayed in
rich text code).
DataFlavor returned by DataFlavor.selectBestTextFlavor is;
MIMEType=text/enriched; class=java.io.InputStream; charset=ascii

On win98 MIMEType returned is text/plain.
On win95/NT MIMEType returned is text/enriched.


To reproduce,

1. Compile and run an attached program "DragDropTest".
2. On solaris: DnD from TextArea at the bottom of the window of test program, or
from native application (ex. text editor)
   On  Win32: DnD from native application (ex. WordPad).



*********miki.tokunaga@japan*********

I discussed with ###@###.### about this bug and 
David will treat the problem in 1.3.1 or later.

miki.tokunaga@japan 2000-03-28








Comments
EVALUATION selectBestTextFlavor is poorly specified as to what it should return. The specification will be modified in a future release to more acurately reflect the proper symantics. However, there is a concern that one cannot transfer non ISO-Latin-1 charasets under the current configuration. Could you please verify that given the DataFlavors past back during a native transfer that you can perform a correct transfer with one of the DataFlavors. Secondly, if jre/lib/flavormap.properties is modified so that the TEXT is modified to contain no charset (see below), does selectBestTextFlavor work correctly? TEXT=text/plain;class=java.io.InputStream roger.brinkley@Eng 2000-02-22 Additional information was requested from submitter. No response so we will lower the priority to 4. roger.brinkley@Eng 2000-02-24 Reproducible in merlin build 25. No doubt this is related to BugID 4187490, and the two bugs may even have the same fix. I will keep this bug open, though, since the probelms are slightly different. For file names, we will have to apply a multibyte conversion to entries inthe HDROP structure, whereas for general text, we'll have to apply a multibyte conversion for the entire byte stream. david.mendenhall@eng 2000-08-02 Name: dsR10078 Date: 10/26/2000 selectBestTextFlavor() is fixed in merlin. We cannot fix it in ladybird, since it requres an API change. In ladybird we made a partial fix for the problem by sorting arrays of DataFlavors returned by DropTargetDropEvent from most richly descriptive to least descriptive. This way if the native application used as drag source properly provides a text in the default encoding you will be able to retrieve this text with the first text/plain data flavor in the returned array. ###@###.### 2000-10-26 ====================================================================== All problems which contributed to this bug, except for proper support of X11 COMPOUND_TEXT, have been resolved. Thus, I am closing this bug as a duplicate of the remaining problem. david.mendenhall@east 2000-11-28
28-11-2000