Project: Eclipse_Platform_UI
Bug 75138 [Encoding] Eclipse's content type support should warn about conflicting settings
Reported: 2004-09-27 23:52:55 | Status: closed fixed

According to XML specification, if encoding is not specified in an XML file, XML processors should process the XML file with XML spec default encoding of UTF-8. However, IFile#getCharset() and IFile#getCharset(boolean) search and use user- defined resource encoding as the encoding for the XML file's if it's available. XML files created with user-defined resource encoding may display okay in Eclipse's Text editor. But, other XML processor may not recognize the user- defined resource encoding and may not be able to display some characters in the XML files. Here is one scenario: - change the "Text file encoding" of an existing XML file from default to BIG5 (or other encodings like Shift_JIS) - open the XML file with Eclipse Text editor - remove the encoding="UTF-8" attribute from XML declaration, if there is one - copy some BIG5 characters from a website into the clipboard - paste the BIG5 characters into the XML file - save and re-open the XML file in Eclipse Text editor - the BIG5 characters should display okay in Eclipse Text editor - but, other XML processors (like Internet Explorer) will not be able to display the BIG5 characters in the XML file Eclipse's content type support should provide a way to force the use of default charset if that's the rule for the content type (in this case, for XML).

Files changed in fix:
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/dialogs/ResourceEncodingFieldEditor.java