| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
After checking stderr for messages the following is generated when a character in the absolute path of the File instance is an <o-acute> java[814] Couldn't convert path "/Volumes/Seagate1/Music/Fijacio?n Oral, Vol. 1/01 En Tus Pupilas.m4p" to an FSRef to put on the pasteboard. dragEnter This is the same message as reported by Pierre. This message is generated even before I can drag out of the Swing application frame. The DragGestureRecognizer is created using the DnDConstants.ACTION_COPY and startDrag is called using ds.startDrag(dge,DragSource.DefaultCopyDrop, ftrans, this); where ftrans is a Transferable created using an array of Files. If multiple files are involved in the transfer the Finder target rejects the drop entirely. Interestingly enough the TextEdit.app accepts the drop with multiple files and displays the incorrectly translated path with a ? instead of the <o-acute> character. On Jul 10, 2006, at 1:47 PM, Greg Guerin wrote:
Using the options above resulted in different failures. Using bullet (shift-option-8) with a filename of 01 Esto°y Aqui.m4p resulted in an error of: 2006-07-10 20:26:35.644 java[809] *** NSThread: ignoring exception '*** -[NSCFArray addObject:]: attempt to insert nil' that raised during delayed perform of target 0x3cb7d0 and selector 'doDrag' Using ae-ligature (option-') with a filename of 01 Estoæy Aqui.m4p resulted in the same error of: 2006-07-10 20:30:06.534 java[810] *** NSThread: ignoring exception '*** -[NSCFArray addObject:]: attempt to insert nil' that raised during delayed perform of target 0x3ca1c0 and selector 'doDrag' When all the special characters are removed from the path and filename, the transfer works perfectly.
Finder will not act on any element in the array if one of the File instances in the array contains the <o-acute> character as part of its path.
Yes, dropping a file on TextEdit.app without any special characters expands to the full pathname. Dropping the problematic file on TextEdit.app displays the path with "?" for the characters it could not decode. Dropping a list of files including the problematic file on TextEdit.app displays the full pathname for all the files including the incorrect path of the file containing the <o-acute>. It looks like I'll need to submit a bug report to Apple. I suspect there is a character set encoding issue when translating the java File instance to a native FSRef instance. I don't think Mac OS X uses UTF-8 as the default character encoding so some form of encoding transformation must be taking place and certain characters appear not translate correctly disrupting the transfer. Perhaps a large number of locale specific characters may fail. Just for grins I setup a file using a single byte Katakana character シ as part of the filename. Don't ask me what it means I just copied the character Word inserted into a document. This had the same failure as <o-acute>. I also tried a Greek/Russian character, リ, and it also had the same failure. Finder to Finder based transfers worked great using these characters. A workaround if non-ascii characters are found in the absolute path maybe to create a temporary file in a "safe" location from the original removing the non-ascii characters. This is not too appealing especially if the files are large but I'm not sure how else to proceed. Also, if the files only contain non-ascii characters for the filename they won't be transferable at all. I'll try on Windows XP over the next day or so as well to see if the behavior is any different. Thanks for all the replies. Bob Potterveld |
_______________________________________________ Do not post admin requests to the list. They will be ignored. Java-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/java-dev/email@hidden This email sent to email@hidden
| References: | |
| >Re: dnd of filenames with locale specific characters (From: Greg Guerin <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.