Search code examples
javascripteclipseencodingutf-8eclipse-luna

Eclipse Luna : can't remove default encoding for javascript and json


I'm trying to remove the default UTF-8 encoding of javascript / json files because I want to use the workspace default text encoding, but it doesn't seem to work with eclipse Luna.

1 - Default encoding set to UTF-8 for javascript files default encoding is UTF-8

2 - I remove the default encoding and click "update" deleting default encoding

3 - If I leave and go back to check javascript file encoding, it's back to UTF-8 (1st image).

Am I missing something here ?


Solution

  • The problem here is that the plugin which defines the JavaScript content type specifies a default encoding of 'UTF-8', when you remove the Default encoding in the dialog the encoding just reverts to this default.

    This means that you can't get this to default to the workspace settings.

    The class org.eclipse.core.internal.content.ContentType defines this behaviour.