What is the default encoding of the JVM?

character-encoding, encoding, java, jvm

Solution

The default character set of the JVM is that of the system it's running on. There's no specific value for this and you shouldn't generally depend on the default encoding being any particular value.

It can be accessed at runtime via `Charset.defaultCharset()`, if that's any use to you, though really you should make a point of always specifying encoding explicitly when you can do so.

Problem

Is UTF-8 the default encoding in Java? If not, how can I know which encoding is used by default?

Original source

Related problems