Wednesday, 22 May 2019

Java: Get standard Character sets


'StandardCharsets' class define standard character sets, that are guaranteed to be available on every implementation of the Java Platform.

App.java
package com.sample.app;

import java.nio.charset.StandardCharsets;

public class App {

 public static void main(String args[]) {
  System.out.println(StandardCharsets.ISO_8859_1);
  System.out.println(StandardCharsets.US_ASCII);
  System.out.println(StandardCharsets.UTF_16);
  System.out.println(StandardCharsets.UTF_16BE);
  System.out.println(StandardCharsets.UTF_16LE);
  System.out.println(StandardCharsets.UTF_8);
 }
}

Output
ISO-8859-1
US-ASCII
UTF-16
UTF-16BE
UTF-16LE

UTF-8


You may like

No comments:

Post a Comment