If you have problem with Intellij Idea, where the content of any files and even the characters you type are encoded improperly, simply switch your theme to another and back (in my case from Darcula to Intellij and back to Darcula).
Here are some screenshots describing the problem: