public final class CharsetProviderICU
extends java.nio.charset.spi.CharsetProvider
Constructor and Description |
---|
CharsetProviderICU()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
java.nio.charset.Charset |
charsetForName(java.lang.String charsetName)
Constructs a charset for the given charset name.
|
java.nio.charset.Charset |
charsetForName(java.lang.String charsetName,
java.lang.String classPath)
Constructs a charset for the given ICU conversion table from the specified class path.
|
java.nio.charset.Charset |
charsetForName(java.lang.String charsetName,
java.lang.String classPath,
java.lang.ClassLoader loader)
Constructs a charset for the given ICU conversion table from the specified class path.
|
java.util.Iterator<java.nio.charset.Charset> |
charsets()
Returns an iterator for the available charsets.
|
static java.lang.String[] |
getAllNames()
Deprecated.
This API is ICU internal only.
|
static java.lang.String[] |
getAvailableNames()
Deprecated.
This API is ICU internal only.
|
static java.lang.String |
getICUCanonicalName(java.lang.String enc)
Deprecated.
This API is ICU internal only.
|
static java.lang.String |
getJavaCanonicalName(java.lang.String charsetName)
Deprecated.
This API is ICU internal only.
|
public CharsetProviderICU()
public final java.nio.charset.Charset charsetForName(java.lang.String charsetName)
charsetForName
in class java.nio.charset.spi.CharsetProvider
charsetName
- charset namepublic final java.nio.charset.Charset charsetForName(java.lang.String charsetName, java.lang.String classPath)
cnv = CharsetProviderICU.charsetForName("myConverter", "com/myCompany/myDataPackage");
.
In this example myConverter.cnv would exist in the com/myCompany/myDataPackage Java package.
Conversion tables can be made with ICU4C's makeconv tool.
This function allows you to allows you to load user defined conversion
tables that are outside of ICU's core data.charsetName
- The name of the charset conversion table.classPath
- The class path that contain the conversion table.public java.nio.charset.Charset charsetForName(java.lang.String charsetName, java.lang.String classPath, java.lang.ClassLoader loader)
charsetForName(String, String)
.charsetName
- The name of the charset conversion table.classPath
- The class path that contain the conversion table.loader
- the class object from which to load the charset conversion tablepublic static final java.lang.String getICUCanonicalName(java.lang.String enc) throws java.nio.charset.UnsupportedCharsetException
enc
- converter namejava.nio.charset.UnsupportedCharsetException
public static java.lang.String getJavaCanonicalName(java.lang.String charsetName)
charsetName
- converter namepublic final java.util.Iterator<java.nio.charset.Charset> charsets()
charsets
in class java.nio.charset.spi.CharsetProvider
public static final java.lang.String[] getAvailableNames()
public static final java.lang.String[] getAllNames()
Copyright (c) 2011 IBM Corporation and others.