Top Description Fields Constructors Methods
com.google.common.base

public final Class Charsets

extends Object
Class Inheritance
Annotations
@GwtCompatible
emulated:true
@ElementTypesAreNonnullByDefault
Imports
com.google.common.annotations.GwtCompatible, .GwtIncompatible, .J2ktIncompatible, java.nio.charset.Charset

Contains constant definitions for the six standard Charset instances, which are guaranteed to be supported by all Java platform implementations.

Assuming you're free to choose, note that UTF_8 is widely preferred.

See the Guava User Guide article on Charsets.

Author
Mike Bostock
Since
1.0

Field Summary

Modifier and TypeField and Description
public static final Charset
ISO_8859_1

ISO-8859-1: ISO Latin Alphabet Number 1 (ISO-LATIN-1).

public static final Charset
US_ASCII

US-ASCII: seven-bit ASCII, the Basic Latin block of the Unicode character set (ISO646-US).

public static final Charset
UTF_16

UTF-16: sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark.

public static final Charset
UTF_16BE

UTF-16BE: sixteen-bit UCS Transformation Format, big-endian byte order.

public static final Charset
UTF_16LE

UTF-16LE: sixteen-bit UCS Transformation Format, little-endian byte order.

public static final Charset
UTF_8

UTF-8: eight-bit UCS Transformation Format.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ISO_8859_1back to summary
public static final Charset ISO_8859_1

ISO-8859-1: ISO Latin Alphabet Number 1 (ISO-LATIN-1).

Java 7+ users: this constant should be treated as deprecated; use java.nio.charset.StandardCharsets#ISO_8859_1 instead.

US_ASCIIback to summary
public static final Charset US_ASCII

US-ASCII: seven-bit ASCII, the Basic Latin block of the Unicode character set (ISO646-US).

Java 7+ users: this constant should be treated as deprecated; use java.nio.charset.StandardCharsets#US_ASCII instead.

Annotations
@J2ktIncompatible
@GwtIncompatible
UTF_16back to summary
public static final Charset UTF_16

UTF-16: sixteen-bit UCS Transformation Format, byte order identified by an optional byte-order mark.

Java 7+ users: this constant should be treated as deprecated; use java.nio.charset.StandardCharsets#UTF_16 instead.

Annotations
@J2ktIncompatible
@GwtIncompatible
UTF_16BEback to summary
public static final Charset UTF_16BE

UTF-16BE: sixteen-bit UCS Transformation Format, big-endian byte order.

Java 7+ users: this constant should be treated as deprecated; use java.nio.charset.StandardCharsets#UTF_16BE instead.

Annotations
@J2ktIncompatible
@GwtIncompatible
UTF_16LEback to summary
public static final Charset UTF_16LE

UTF-16LE: sixteen-bit UCS Transformation Format, little-endian byte order.

Java 7+ users: this constant should be treated as deprecated; use java.nio.charset.StandardCharsets#UTF_16LE instead.

Annotations
@J2ktIncompatible
@GwtIncompatible
UTF_8back to summary
public static final Charset UTF_8

UTF-8: eight-bit UCS Transformation Format.

Java 7+ users: this constant should be treated as deprecated; use java.nio.charset.StandardCharsets#UTF_8 instead.

Constructor Detail

Charsetsback to summary
private Charsets()