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?

0
2 comments

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 :)

0

Please sign in to leave a comment.