Wednesday, July 11, 2007

IntelliJ IDEA charset encoding plugin released in v1.0

I have just released my first and very own, IntelliJ IDEA plugin. Hurray! :-) I have named it "encoding-plugin" and you can see it here.

One very annoying thing in IDEA, is that the charset encoding setting is at the IDE-level, and not project-level. When different projects use different encodings for their sources, you will need to:
  1. Remember to set IDE-level charset encoding correct before opening project
  2. If IDE-level setting changed, restart IDEA to make it take effect
  3. Cleanup the project files that became trashed anyway, because someone forgot the above steps and edited a file, using the wrong IDE-level encoding
There are actually lots of issues in IDEA jira about it, and an explanation about why it is so, can be seen here (think about voting for it!).

How does encoding-plugin help?
It provides you with an option to select a charset encoding (UTF-8, ISO-8859-1, ...) but at the project level. It does not though, actually change the charset encoding when opening a project. This is still not possible in IDEA.

What it can do though, is warn you, or someone else opening the project, if the IDE-level charset encoding and the project-level charset encoding does not match at project open.

Installation is easy
It is in the official repository, so you can just fire up your IDEA, go to settings, plugins, and find it in the list. It is under "Misc" category, with the name "EncodingPlugin".

I have tested it with 6.0.1 and up to Selena release build #7041. As this is what I have tested with, I have set the required build number to be at least #5784, which is 6.0.1. If you are using an older version and would like to use the plugin, drop me a note and I will have a look at it.

Usage
While having a project open, go to settings and find the plugin config under the project settings.


Choose your project charset encoding. From here on, when project is opened, it will be checked against IDE-level setting.

No comments: