Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 56903

Summary: allow plugins to associate new file specs to existing content types
Product: [Eclipse Project] Platform Reporter: Tod Creasey <Tod_Creasey>
Component: ResourcesAssignee: Rafael Chaves <eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse, eclipse, michaelvanmeekeren
Version: 3.0   
Target Milestone: 3.0 M9   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Screenshot of the encoding issue none

Description Tod Creasey CLA 2004-03-31 08:33:11 EST
M8

In M8 Projects with Chinese names have .project files with different names 
then entered. The directory created is correct, just not the the file. We 
suspect that this might be a symptom of some other encoding issues we have 
seen.

STEPS
1) Go to a Chinese XP machine with GB18030 support
2) Create a project with the name created using the IME
3) Open the .project file in either notepad or the text editor (be sure the 
text editor is using a Chinese font)
4) Names are different.

I will attach a screenshot
Comment 1 Tod Creasey CLA 2004-03-31 08:35:11 EST
Created attachment 9047 [details]
Screenshot of the encoding issue
Comment 2 Rafael Chaves CLA 2004-03-31 09:20:01 EST
I need more context here... why is this bug blocking bug 56437?
Comment 3 Rafael Chaves CLA 2004-03-31 09:32:05 EST
The issue here is that the text editor is not using UTF-8 to read the file. The
file is properly written. Since Platform/Text already adopted the infrastructure
provided by Core to guess encoding, it is probably a bug in our support.
Investigating...

Notepad does not seem to do any guessing, so it is just opening a UTF-8 encoded
file with platform's default encoding.
Comment 4 Rafael Chaves CLA 2004-03-31 09:47:35 EST
We don't recognize .project as a XML file, so we don't try to guess its
encoding. Not sure we should be any smarter than this. Interested parties (such
as Resources, Java Core) could provide external association between their
specially-name XML files (such as .project and .classpath) and the XML content type.
Comment 5 Rafael Chaves CLA 2004-03-31 10:11:16 EST
Original summary: "Chinese project names being written incorrectly to .project
files"

Removing dependency. This is not a new issue, it has always been this way. Tod,
please open another PR if you believe Core is the culprit in bug 56437.

Changing summary to address the need of providing means for other plugins to
associate new file specifications to existing content types.

Comment 6 Rafael Chaves CLA 2004-04-06 10:54:00 EDT
Fixed. Available from i20040606 on.

Temporarily, Runtime will be providing associations for .project and .classpath:

<extension point="org.eclipse.core.runtime.contentTypes">
  <file-association content-type="org.eclipse.core.runtime.xml"
file-names=".project"/>
  <file-association content-type="org.eclipse.core.runtime.xml"
file-names=".classpath"/>
</extension>