Package org.apache.commons.codec.net

Examples of org.apache.commons.codec.net.BCodec


    String newName = attach_name;
    try {
      if (null != agent && -1 != agent.indexOf("MSIE")) {
        newName = URLEncoder.encode(attach_name, "UTF-8");
      } else {
        newName = new BCodec("UTF-8").encode(attach_name);
      }
    } catch (Exception e) {
      logger.error("cannot encode " + attach_name, e);
      return attach_name;
    }
View Full Code Here


    if (value == null) return null;
    try {
      switch(codec) {
        case Q:  return (new QCodec(charset)).encode(value);
        case B:
        default: return (new BCodec(charset)).encode(value);
      }
    } catch (Exception e) {
      return value;
    }
  }
View Full Code Here

   */
  public static String decode(String value) {
    if (value == null) return null;
    try {
      // try BCodec first
      return (new BCodec()).decode(value);
    } catch (DecoderException de) {
      // try QCodec next
      try {
        return (new QCodec()).decode(value);
      } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of org.apache.commons.codec.net.BCodec

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.