CharsetNames Encoding for Charset.forName (String)

I have a question about Charset.forName (String charsetName). Is there a list of charset names that I can reference? For example, for UTF-8 we use "utf8" for charsetName. What about WINDOWS-1252, GB18030, etc.?

+5
source share
2 answers
Charset description

US-ASCII Seven-bit ASCII, aka ISO646-US, aka the Basic Latin block of the Unicode character set
ISO-8859-1 ISO Latin Alphabet No. 1, aka ISO-LATIN-1
UTF-8 Eight-bit UCS Transformation Format
UTF-16BE Sixteen-bit UCS Transformation Format, big-endian byte order
UTF-16LE Sixteen-bit UCS Transformation Format, little-endian byte order
UTF-16 Sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark

Link: http://docs.oracle.com/javase/7/docs/api/java/nio/charset/Charset.html

+5
source

Java encoding names are platform dependent; there are only 6 constants in the StandardCharsets class .

To view all encodings, you must look at IANA . Check your preferred MIME Name and aliases columns.

+2
source

All Articles