类 CharsetConvert

java.lang.Object
com.alibaba.druid.filter.encoding.CharsetConvert

public class CharsetConvert extends Object
字符编码转换器
作者:
xianmao.hexm 2007-3-5 09:51:33
  • 构造器详细资料

    • CharsetConvert

      public CharsetConvert(String clientEncoding, String serverEncoding)
  • 方法详细资料

    • encode

      public String encode(String s) throws UnsupportedEncodingException
      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.
      参数:
      s - the string to be encoded
      返回:
      the encoded string, or the original string if encoding is not enabled or the input string is empty
      抛出:
      UnsupportedEncodingException - if the specified encoding is not supported
    • decode

      public String decode(String s) throws UnsupportedEncodingException
      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.
      参数:
      s - the string to be decoded
      返回:
      the decoded string, or the original string if decoding is not enabled or the input string is empty
      抛出:
      UnsupportedEncodingException - if the specified encoding is not supported
    • isEmpty

      public boolean isEmpty(String s)
      Determines whether the specified string is null or empty.
      参数:
      s - the string to be checked
      返回:
      true if the specified string is null or empty, false otherwise