Package org.apache.tika.utils
Class CharsetUtils
java.lang.Object
org.apache.tika.utils.CharsetUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Handle various common charset name errors, and return something that will be considered valid (and is normalized)static Charset
Returns Charset impl, if one exists.static boolean
isSupported
(String charsetName) Safely return whetheris supported, without throwing exceptions
-
Constructor Details
-
CharsetUtils
public CharsetUtils()
-
-
Method Details
-
isSupported
Safely return whetheris supported, without throwing exceptions - Parameters:
charsetName
- Name of charset (can be null)- Returns:
- true if the character set is supported
-
clean
Handle various common charset name errors, and return something that will be considered valid (and is normalized)- Parameters:
charsetName
- name of charset to process- Returns:
- potentially remapped/cleaned up version of charset name
-
forName
Returns Charset impl, if one exists. This method optionally uses ICU4J's CharsetICU.forNameICU, if it is found on the classpath, else only uses JDK's builtin Charset.forName.
-