Class CharsetConvert
java.lang.Object
com.alibaba.druid.filter.encoding.CharsetConvert
字符编码转换器
- Author:
- xianmao.hexm 2007-3-5 09:51:33
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDecodes the specified string using the specified server and client encodings, if enabled.Encodes the specified string using the specified client and server encodings, if enabled.booleanDetermines whether the specified string is null or empty.
-
Constructor Details
-
CharsetConvert
-
-
Method Details
-
encode
Encodes the specified string using the specified client and server encodings, if enabled. If encoding is not enabled or the input string is empty, the original string is returned unchanged.- Parameters:
s- the string to be encoded- Returns:
- the encoded string, or the original string if encoding is not enabled or the input string is empty
- Throws:
UnsupportedEncodingException- if the specified encoding is not supported
-
decode
Decodes the specified string using the specified server and client encodings, if enabled. If decoding is not enabled or the input string is empty, the original string is returned unchanged.- Parameters:
s- the string to be decoded- Returns:
- the decoded string, or the original string if decoding is not enabled or the input string is empty
- Throws:
UnsupportedEncodingException- if the specified encoding is not supported
-
isEmpty
Determines whether the specified string is null or empty.- Parameters:
s- the string to be checked- Returns:
- true if the specified string is null or empty, false otherwise
-