Bug 107200 - Copying filename in Finder to Eclipse encoding problem
Summary: Copying filename in Finder to Eclipse encoding problem
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: Macintosh Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2005-08-17 08:51 EDT by Azudio CLA
Modified: 2007-06-22 10:04 EDT (History)
1 user (show)

See Also:


Attachments
Simple class that outputs text (634 bytes, text/plain)
2005-08-17 09:49 EDT, Azudio CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Azudio CLA 2005-08-17 08:51:09 EDT
OS: OS X 10.4.2 Tiger
JVM: 1.5.0_02
Eclipse: 3.1

Selecting a file in the Mac OS X Finder and copying (cmd-c), returning to Eclipse and pasting into a 
method that defines a file path will result in question marks appearing in filename when file.getName() 
called eg: ???somefile.txt', appears to be an encoding issue.

OS-X Tiger uses UTF-16

See:
http://discussions.info.apple.com/webx?14@536.vbzpayFB6mc.1@.68b6d7c8
Comment 1 Dani Megert CLA 2005-08-17 08:56:49 EDT
>and pasting into a method that defines a file path
Can you explain a bit more? Excapt steps would be good, e.g. where exactly do
you see the question marks.

See also:
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-text-home/development/bug-incomplete.htm
Comment 2 Azudio CLA 2005-08-17 09:26:49 EDT
(In reply to comment #1)
> >and pasting into a method that defines a file path
> Can you explain a bit more? Excapt steps would be good, e.g. where exactly do
> you see the question marks.
> 
> See also:
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/platform-text-home/development/bug-
incomplete.htm

Sorry, to simplify:

Step 1: 
In the Finder select/highlight a file, say 'whoops.txt', then copy the file to the pasteboard (cmd-c)

Step 2:
Back in Eclipse create the following code:
System.out.println("whoops.txt?"); // Paste in from the clipboard

Step 3:
Execute, what I get is something like in the console: 
??whoops.txt

Deleting and retyping 'whoops.txt' outputs 'whoops.txt' without any problems
Comment 3 Dani Megert CLA 2005-08-17 09:35:34 EDT
step 2: I assume you paste between "<caret>", right? Where does the '?' come
from at the end?

step 3: with execute youe mean you have a Java class with a main(...) that
contains the println, correct?

How do you start the class?
What is the encoding of that Java file in Eclipse?
Comment 4 Azudio CLA 2005-08-17 09:49:22 EDT
Created attachment 26197 [details]
Simple class that outputs text
Comment 5 Dani Megert CLA 2005-08-17 11:32:04 EDT
The pasted text is correct i.e. looks good in the editor and when you run the
code it is wrongly displayed in the Console, right? If that's the case then you
have to set the encoding on the 'Common' tab of your launch configuration.
Comment 6 Dani Megert CLA 2007-06-22 09:59:26 EDT
Get rid of deprecated state.
Comment 7 Dani Megert CLA 2007-06-22 10:04:39 EDT
.