Package org.bardframework.commons.utils
Class CharsetUtils
java.lang.Object
org.bardframework.commons.utils.CharsetUtils
Demonstrate default Charset-related details.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Charsetstatic StringSupplies the default encoding without using Charset.defaultCharset() and without accessing System.getProperty("file.encoding").static Localestatic Stringstatic Stringstatic CharsetReturns a Charset for the named charset.static CharsetReturns the given Charset or the default Charset if the given Charset is null.
-
Constructor Details
-
CharsetUtils
public CharsetUtils()
-
-
Method Details
-
toCharset
Returns a Charset for the named charset. If the name is null, return the default Charset.- Parameters:
charset- The name of the requested charset, may be null.- Returns:
- a Charset for the named charset
- Throws:
UnsupportedCharsetException- If the named charset is unavailable
-
toCharset
Returns the given Charset or the default Charset if the given Charset is null.- Parameters:
charset- A charset or null.- Returns:
- the given Charset or the default Charset if the given Charset is null
-
getDefaultEncoding
Supplies the default encoding without using Charset.defaultCharset() and without accessing System.getProperty("file.encoding").- Returns:
- Default encoding (default charset).
-
getDefaultLocale
-
getDefaultCharset
-
getSunEncoding
- Returns:
- sun.jnu.encoding
-
getFileEncoding
- Returns:
- file.encoding
-