public final class CharsetSelector extends Object
Constructor and Description |
---|
CharsetSelector(List<String> charsetList,
UnicodeSet excludedCodePoints,
int mappingTypes)
Construct a CharsetSelector from a list of charset names.
|
Modifier and Type | Method and Description |
---|---|
List<String> |
selectForString(CharSequence unicodeText)
Select charsets that can map all characters in a CharSequence, ignoring
the excluded code points.
|
public CharsetSelector(List<String> charsetList, UnicodeSet excludedCodePoints, int mappingTypes)
charsetList
- a list of charset names in the form of strings. If charsetList
is empty, a selector for all available charset is constructed.excludedCodePoints
- a set of code points to be excluded from consideration.
Excluded code points appearing in the input CharSequence do
not change the selection result. It could be empty when no
code point should be excluded.mappingTypes
- an int which determines whether to consider only roundtrip
mappings or also fallbacks, e.g. CharsetICU.ROUNDTRIP_SET. See
CharsetICU.java for the constants that are currently
supported.IllegalArgumentException
- if the parameters is invalid.IllegalCharsetNameException
- If the given charset name is illegal.UnsupportedCharsetException
- If no support for the named charset is available in this
instance of the Java virtual machine.public List<String> selectForString(CharSequence unicodeText)
unicodeText
- a CharSequence. It could be empty.Copyright © 2016 Unicode, Inc. and others.