Package net.sf.basedb.util.charset
Class CharsetUtil
java.lang.Object
net.sf.basedb.util.charset.CharsetUtil
Helper class for working with charsets and enabling the UTF-8 with fallback charsets:
X-UTF-8_with_ISO-8859-1_fallback
X-UTF-8_with_windows-1252_fallback
- Since:
- 3.15
- Author:
- nicklas
-
Field Summary
Modifier and TypeFieldDescriptionstatic final CharsetProvider
The provider that is providing the UTF-8 with fallback characeter sets. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Enumeration<String,
String> asEnumeration
(Collection<String> charsets) Convert charset names to an enumeration with display-friendly key/title pairs.getAllCharsets
(boolean includeFallbacks) Get all charsets thatConfig.getAllCharsets()
returns and optionally include the fallback charsets.static Charset
getCharset
(String name) Get a character set by name.
-
Field Details
-
UTF8_WITH_FALLBACK
The provider that is providing the UTF-8 with fallback characeter sets.
-
-
Constructor Details
-
CharsetUtil
public CharsetUtil()
-
-
Method Details
-
getCharset
Get a character set by name. This will first look if it is a UTF-8 with fallback charset and if not check the systemCharset.forName(String)
. -
getAllCharsets
Get all charsets thatConfig.getAllCharsets()
returns and optionally include the fallback charsets. Note that the fallback charsets are automatically sorted just below the UTF-8 character set. -
asEnumeration
Convert charset names to an enumeration with display-friendly key/title pairs.
-