How does IntelliJ modify Charset.defaultCharset?
Answered
Execute this in IntelliJ:
public class Main {
public static void main (String[] args) {
System.out.println(Charset.defaultCharset());
}
}
And it will most likely print "UTF-8". Now export it as runnable JAR file and execute it with the same Java binary - and (under Windows) it will print "windows-1252".
Then, explain to me why this happens :-) Please?
Please sign in to leave a comment.
Check the command line, IDE passes `-Dfile.encoding=UTF-8`.
See also http://blogs.jetbrains.com/idea/2013/03/use-the-utf-8-luke-file-encodings-in-intellij-idea/.
Wow, that was super quick. Thank you very much.
I actually wanted to check the command line, turns out I only checked the environment variables :)