2012-09-23 13 views
5

Mam pytanie dotyczące charset.forName (String charsetName). Czy istnieje lista charsetNames, do których mogę się odnosić? Na przykład dla UTF-8 używamy "utf8" dla charsetName. A co z WINDOWS-1252, GB18030 itp.?Kodowanie znaków charsetNames dla Charset.forName (String)

+2

http://docs.oracle.com/javase/6/docs/technotes/guides/intl/encoding.doc.html i najnowsze http://download.java.net/jdk8/docs/technotes/guides /intl/encoding.doc.html – nullpotent

+0

Istnieje również dobra dyskusja na http://stackoverflow.com/questions/1684040/java-why-charset-names-are-not-constants –

Odpowiedz

5
 
Charset   Description 

US-ASCII  Seven-bit ASCII, a.k.a. ISO646-US, a.k.a. the Basic Latin block of the Unicode character set 
ISO-8859-1  ISO Latin Alphabet No. 1, a.k.a. 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 

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

2

Nazwy charset w Javie są zależne od platformy, są tylko 6 stałymi w klasie StandardCharsets.

Aby wyświetlić wszystkie zestawy znaków, należy spojrzeć na IANA. Zaznacz Preferowaną nazwę MIME i aliasy kolumn.

Powiązane problemy