com.ibm.icu.charset
Class CharsetICU
java.lang.Object
java.nio.charset.Charset
com.ibm.icu.charset.CharsetICU
- All Implemented Interfaces:
- java.lang.Comparable
public abstract class CharsetICU
- extends java.nio.charset.Charset
A subclass of java.nio.Charset for providing implementation of ICU's charset converters.
This API is used to convert codepage or character encoded data to and
from UTF-16. You can open a converter with Charset.forName(java.lang.String)
and forNameICU(java.lang.String)
. With that
converter, you can get its properties, set options, convert your data.
Since many software programs recogize different converter names for
different types of converters, there are other functions in this API to
iterate over the converter aliases.
- Status:
- Draft ICU 3.6.
Constructor Summary |
protected |
CharsetICU(java.lang.String icuCanonicalName,
java.lang.String canonicalName,
java.lang.String[] aliases)
|
Method Summary |
boolean |
contains(java.nio.charset.Charset cs)
Ascertains if a charset is a sub set of this charset
Implements the abstract method of super class. |
static java.nio.charset.Charset |
forNameICU(java.lang.String charsetName)
Returns a charset object for the named charset. |
Methods inherited from class java.nio.charset.Charset |
aliases, availableCharsets, canEncode, compareTo, compareTo, decode, defaultCharset, displayName, displayName, encode, encode, equals, forName, hashCode, isRegistered, isSupported, name, newDecoder, newEncoder, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
CharsetICU
protected CharsetICU(java.lang.String icuCanonicalName,
java.lang.String canonicalName,
java.lang.String[] aliases)
- Parameters:
icuCanonicalName
- canonicalName
- aliases
- - Status:
- Draft ICU 3.6.
contains
public boolean contains(java.nio.charset.Charset cs)
- Ascertains if a charset is a sub set of this charset
Implements the abstract method of super class.
- Specified by:
contains
in class java.nio.charset.Charset
- Parameters:
cs
- charset to test
- Returns:
- true if the given charset is a subset of this charset
- Status:
- Stable ICU 3.6.
forNameICU
public static java.nio.charset.Charset forNameICU(java.lang.String charsetName)
throws java.nio.charset.IllegalCharsetNameException,
java.nio.charset.UnsupportedCharsetException
- Returns a charset object for the named charset.
This method gurantee that ICU charset is returned when
available. If the ICU charset provider does not support
the specified charset, then try other charset providers
including the standard Java charset provider.
- Parameters:
charsetName
- The name of the requested charset,
may be either a canonical name or an alias
- Returns:
- A charset object for the named charset
- Throws:
java.nio.charset.IllegalCharsetNameException
- If the given charset name
is illegal
java.nio.charset.UnsupportedCharsetException
- If no support for the
named charset is available in this instance of th Java
virtual machine- Status:
- Draft ICU 3.6.
Copyright (c) 2007 IBM Corporation and others.