Bug 421391 - [Import/Export] import filesystem failed to import file with 2 byte characters in filename like german umlauts
Summary: [Import/Export] import filesystem failed to import file with 2 byte character...
Status: CLOSED DUPLICATE of bug 397226
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.3.1   Edit
Hardware: PC Mac OS X
: P3 normal with 3 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact: Daniel Rolka CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-09 07:36 EST by Burghard Britzke CLA
Modified: 2013-11-26 11:07 EST (History)
2 users (show)

See Also:


Attachments
the file selection dialog showing files with 2 byte characters in filename the wrong way (67.16 KB, image/png)
2013-11-09 07:36 EST, Burghard Britzke CLA
no flags Details
the error message showing 2 byte characters in a filename as ""Error opening input stream for <filename>". The 2 Byte characters in the filename are displayed as "��" (78.87 KB, image/png)
2013-11-09 07:39 EST, Burghard Britzke CLA
no flags Details
the file which has been tried to import. (69 bytes, text/plain)
2013-11-11 17:59 EST, Burghard Britzke CLA
no flags Details
the file selection dialog while selecting the directory shows the correct filenames as "File->Open File..." does (268.74 KB, image/png)
2013-11-13 13:30 EST, Burghard Britzke CLA
no flags Details
the resulting import dialog shows the files to import from that directory with wrong characters (131.86 KB, image/png)
2013-11-13 13:31 EST, Burghard Britzke CLA
no flags Details
Font settings for the Dialog Font on a Mac (248.46 KB, image/png)
2013-11-23 05:13 EST, Burghard Britzke CLA
no flags Details
the file selection dialog for selecting the directory to import from - note the font is the system font not the dialog font (161.49 KB, image/png)
2013-11-25 09:43 EST, Burghard Britzke CLA
no flags Details
after selecting the directory to import. the files to select shows the wrong filename (event in Times New Roman) (183.71 KB, image/png)
2013-11-25 09:44 EST, Burghard Britzke CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Burghard Britzke CLA 2013-11-09 07:36:58 EST
Created attachment 237330 [details]
the file selection dialog showing files with 2 byte characters in filename the wrong way

on OS X 10.9, import of files failes with the error "Error opening input stream for <filename>". The 2 Byte characters in the filename are displayed as "��". Even in the file selection dialog the 2 byte characters of the filenames are displayed the wrong way.

Steps to reproduce:
1.) Create a Project (may be with UTF-8 encoding)
2.) Select File->Import... -> General->File System
3.) Select a directory with files containing 2 byte characters in the filename.
The 2 byte characters in the filenames are displayed es "��"
4.) Select a file with 2 byte characters in the filename and click "Finish"
An error is raised "Problems occurred during import:
The details section showes: "Error opening input stream for <filename>". The 2 Byte characters in the filename are displayed as "��".


It is not possible to import such a file by drag and drop, too.
Comment 1 Burghard Britzke CLA 2013-11-09 07:39:31 EST
Created attachment 237331 [details]
the error message showing 2 byte characters in a filename as ""Error opening input stream for <filename>". The 2 Byte characters in the filename are displayed as "��"
Comment 2 Dani Megert CLA 2013-11-11 05:00:10 EST
Does the file display correctly and open in the editor when using File > Open File?

Could you attach a ZIP file with the file that has problems?
Comment 3 Burghard Britzke CLA 2013-11-11 17:59:15 EST
Created attachment 237380 [details]
the file which has been tried to import.

the file is opened correctly (with the external editor TextEdit) when trying to open it  via File->open File... The file selection dialog here shows the correct filename.
Comment 4 Burghard Britzke CLA 2013-11-11 18:04:06 EST
It is also possible to create a new file with File->New->File with 2 byte UTF-8 characters in the file name. The Problem occurs if the file is 
1. copied via drag and drop to another location in the same project or if it is 
2. imported via drag and drop into a project or if it is 
3. imported using the project wizard.
Comment 5 Burghard Britzke CLA 2013-11-11 18:58:34 EST
if it is copied from one location to another location in a project, no error is displayed. but the filename is changed. every 2 byte character is displayed by a question mark (?) at the target location.
Comment 6 Dani Megert CLA 2013-11-13 08:35:04 EST
(In reply to Burghard Britzke from comment #3)
> Created attachment 237380 [details]
> the file which has been tried to import.
> 
> the file is opened correctly (with the external editor TextEdit) when trying
> to open it  via File->open File... The file selection dialog here shows the
> correct filename.

And it then opens in Eclipse?

I suspect that you start Eclipse with a non-UTF-8 encoding. What encoding is shown on the General > Workspace preference page? Another problem could be that the font used in Eclipse cannot display/contain those characters.
Comment 7 Burghard Britzke CLA 2013-11-13 13:28:46 EST
(In reply to Burghard Britzke from comment #6)

> And it then opens in Eclipse?
no! it opens in an external editor. but it is opened from eclipse from File->Open File...
In the File Selection Box the äöüß-Characters are displayed correctly.
But when I try to Import the same File with File->Import... File System and browse to select the directory to import from  (in this file selection box the filenames are displayed correctly), then in the resulting dialog where I can select the files... the filenames are displayed as "��".
(see the both new attachments)

> I suspect that you start Eclipse with a non-UTF-8 encoding.
no! I am starting with UTF-8 for the whole workspace (and all Projects and Files).

> What encoding is shown on the General > Workspace preference page?
The preferences page shows other: UTF-8 (default for Mac OS X would be US-ASCII)

> Another problem could be that the font used in Eclipse cannot display/contain those characters.
If I create a File within Eclipse, the filename would be displayed correctly, until I move it per drag and drop. Then question marks substitute the two Byte Characters.
Comment 8 Burghard Britzke CLA 2013-11-13 13:30:22 EST
Created attachment 237442 [details]
the file selection dialog while selecting the directory shows the correct filenames as "File->Open File..." does
Comment 9 Burghard Britzke CLA 2013-11-13 13:31:22 EST
Created attachment 237443 [details]
the resulting import dialog shows the files to import from that directory with wrong characters
Comment 10 Burghard Britzke CLA 2013-11-13 13:38:33 EST
See bug 312832 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=312832). This may be the same or a similar filename handling issue, which has raises with one of the last eclipse version.
Both have not been there in previous releases (early this year or in the last year).
Comment 11 Dani Megert CLA 2013-11-22 04:03:24 EST
I'm pretty sure this is a font issue. Please go to the 'Colors and Fonts' preference page and set the 'Dialog Font' to be the same as used in the OS.
Comment 12 Burghard Britzke CLA 2013-11-22 06:40:11 EST
(In reply to Dani Megert from comment #11)
> I'm pretty sure this is a font issue. Please go to the 'Colors and Fonts'
> preference page and set the 'Dialog Font' to be the same as used in the OS.

The font has been the system font (Lucida Grande). I checked it and I also selected "system font" but it didn't change.

I tried the import again and again the same error orrurs.

I do not agree that this is a font issue because after selecting the file and try to import. it really tries to open an input stream and fails. that can not be a font issue.
Comment 13 Burghard Britzke CLA 2013-11-22 06:41:13 EST
It can not be repeated on Ubuntu 10.04 linux. The import works well there.
Comment 14 Burghard Britzke CLA 2013-11-22 13:01:10 EST
(In reply to Dani Megert from comment #11)
> I'm pretty sure this is a font issue. Please go to the 'Colors and Fonts'
> preference page and set the 'Dialog Font' to be the same as used in the OS.

if it would be a font problem, only one "�" character would be shown. It seems that another character encoding is expected (like US-ASCII) which is the default for eclipse on os x. And so two characters are shown, because US-ASCII only knows 1 byte characters.
Comment 15 Dani Megert CLA 2013-11-22 13:17:45 EST
(In reply to Burghard Britzke from comment #12)
> I do not agree that this is a font issue because after selecting the file
> and try to import. it really tries to open an input stream and fails. that
> can not be a font issue.

Why do you say that? You can clearly verify that the font is used to display that information, while it does not apply to the OS dialog. Anyway, if you think you better know what the problem is, then that's OK with me.
Comment 16 Dani Megert CLA 2013-11-23 03:14:57 EST
Please double-check the dialog font. For a test I've started Eclipse with US-ASCII file encoding and a new workspace: files with non-ASCII names work great. If I then choose a different dialog font, they start to be wrongly displayed.
Comment 17 Burghard Britzke CLA 2013-11-23 05:00:34 EST
(In reply to Dani Megert from comment #15)
> (In reply to Burghard Britzke from comment #12)
> > I do not agree that this is a font issue because after selecting the file
> > and try to import. it really tries to open an input stream and fails. that
> > can not be a font issue.
> 
> Why do you say that? You can clearly verify that the font is used to display
> that information, while it does not apply to the OS dialog. Anyway, if you
> think you better know what the problem is, then that's OK with me.

pardon, i do not want to know it better, but rather discuss a problem, hoping to make it reproducible for that developers who know how to fix it. This includes, that perhaps I made a problematic setting on my workspace or project which produces this error. for this case I hope to get a tipp how I can fix it my self.
Comment 18 Burghard Britzke CLA 2013-11-23 05:10:47 EST
(In reply to Dani Megert from comment #16)
> Please double-check the dialog font. For a test I've started Eclipse with
> US-ASCII file encoding and a new workspace: files with non-ASCII names work
> great. If I then choose a different dialog font, they start to be wrongly
> displayed.

I created a new Workspace with US-ASCI Character Encoding.
When I create a new file with a non-ASCII name, it works well (the Characters in the Project Explorer are displayed with umlauts).
But when I try to IMPORT a file with non-ASCII names I get the described error (on my Mac).

I double checked the Dialog-Font and selected "Use System Font" for the dialog font twice. It does not change. I will upload a screen shot of my font settings.
Comment 19 Burghard Britzke CLA 2013-11-23 05:13:33 EST
Created attachment 237657 [details]
Font settings for the Dialog Font on a Mac
Comment 20 Dani Megert CLA 2013-11-25 08:59:18 EST
(In reply to Burghard Britzke from comment #19)
> Created attachment 237657 [details]
> Font settings for the Dialog Font on a Mac

Is Lucida Grande 11 the font you use on the OS? Maybe we get/detect the wrong font?

Also, please try this:
- Set that font to be used as the 'Text' font and then check whether the font
  works in the Text Editor
- Try whether using another font for the 'Dialog Font' works
Comment 21 Burghard Britzke CLA 2013-11-25 09:41:36 EST
(In reply to Dani Megert from comment #20)
> (In reply to Burghard Britzke from comment #19)
> > Created attachment 237657 [details]
> > Font settings for the Dialog Font on a Mac
> 
> Is Lucida Grande 11 the font you use on the OS? Maybe we get/detect the
> wrong font?
Yes Lucida Grande is the font standardly used as OS font on Mac OS X.

> 
> Also, please try this:
> - Set that font to be used as the 'Text' font and then check whether the font
>   works in the Text Editor
- I set "Lucida Grande" as font for 'Text' and opened an editor with a new file.
- I type "äöüß". It is shown correctly.
- If i try to save the file, it could not because of the US-ASCII settings.
 
> - Try whether using another font for the 'Dialog Font' works
- I set "Times New Roman" as 'Dialog Font'.
- I tried to Import with the same result (only the font has changed)
I will upload the results
Comment 22 Burghard Britzke CLA 2013-11-25 09:43:27 EST
Created attachment 237689 [details]
the file selection dialog for selecting the directory to import from - note the font is the system font not the dialog font
Comment 23 Burghard Britzke CLA 2013-11-25 09:44:51 EST
Created attachment 237690 [details]
after selecting the directory to import. the files to select shows the wrong filename (event in Times New Roman)
Comment 24 Markus Keller CLA 2013-11-26 09:55:11 EST
This is a very tricky bug in the Oracle JRE for Mac OS X.

Workaround: http://www.eclipse.org/eclipse/development/readme_eclipse_4.3.php#I-Platform

*** This bug has been marked as a duplicate of bug 397226 ***
Comment 25 Markus Keller CLA 2013-11-26 10:19:25 EST
(In reply to Markus Keller from comment #24)
> This is a very tricky bug in the Oracle JRE for Mac OS X.

Note: This problem has been fixed in jdk1.7.0_40 and later, so updating to a current version of Java is enough to make this work.
Comment 26 Burghard Britzke CLA 2013-11-26 11:07:58 EST
The Oracle Java Update for Mac OS does not fix the Symlink /usr/bin/java and so the old Java has been active, still after Updating to java 1.7_45.
And so Eclipse starts with the old Java Version.

After installing the actual JDK 1.7.45 (not JRE), the error is fixed.

This could also affect  bug 312832 - i will check/report it.