Get the default encoding of your computer in Java

Description

The following code shows how to get the default encoding of your computer.

Example


/*from  w w  w  . ja v  a  2s. c om*/
public class Main {
  public static void main(String[] a) {
    System.out.println(System.getProperty("file.encoding"));
  }
}

The code above generates the following result.





















Home »
  Java Tutorial »
    Development »




Java Algorithms
Java Clipboard
Java Compiler
Java Desktop
Java Virtual Machine
Java Math
OS
Random
Java Robot
Java RuntimeMXBean
Java Timer
Java UUID
Java Internationalization