Package com.ibm.wsspi.http
Interface EncodingUtils
public interface EncodingUtils
EncodingUtils provides various methods for manipulating and retrieving
information related to charsets, locales, and other encoding data.
-
Method Summary
Modifier and TypeMethodDescriptionBasically returns everything after ";charset=".Query the default encoding.getEncodingFromLocale
(Locale locale) Get the encoding for a passed in locale.getJvmConverter
(String encoding) Get the JVM Converter for the specified encoding.getLocales
(String acceptLangHdr) Returns a list of locales from the passed in Accept-Language header.boolean
isCharsetSupported
(String charset) Tests whether the specified charset is supported on the server.stripQuotes
(String value) Utility method to trim off any leading or trailing quotes (single or double).
-
Method Details
-
getDefaultEncoding
String getDefaultEncoding()Query the default encoding.- Returns:
- String
-
getCharsetFromContentType
Basically returns everything after ";charset=". If no charset specified, return null.- Parameters:
type
- to extract the charset from.- Returns:
- The charset encoding.
-
getLocales
Returns a list of locales from the passed in Accept-Language header.- Parameters:
acceptLangHdr
-- Returns:
- List
-
getEncodingFromLocale
Get the encoding for a passed in locale.- Parameters:
locale
-- Returns:
- The encoding.
-
getJvmConverter
Get the JVM Converter for the specified encoding.- Parameters:
encoding
-- Returns:
- The converter if it exists, otherwise return the encoding.
-
isCharsetSupported
Tests whether the specified charset is supported on the server.- Parameters:
charset
- we want to test- Returns:
- boolean indicating if supported
-
stripQuotes
Utility method to trim off any leading or trailing quotes (single or double).- Parameters:
value
-- Returns:
- String (null if null input provided)
-