Package plugins.Freetalk.ui.NNTP.MIME

Examples of plugins.Freetalk.ui.NNTP.MIME.TransferEncoding


      result.append(str.substring(pos, matcher.start()));

      try {
        Charset charset = Charset.forName(charsetName);
        TransferEncoding encoding = TransferEncoding.headerWordEncoding(encodingName);
        byte[] encodedBytes = data.getBytes("US-ASCII");
        ByteBuffer decodedBytes = encoding.decode(ByteBuffer.wrap(encodedBytes));
        result.append(charset.decode(decodedBytes));
      }
      catch (Exception e) {
        result.append(matcher.group());
      }
View Full Code Here


      Logger.error(this, "Illegal charset received", e);
      bodyCharset = Charset.forName("UTF-8");
    }

    try {
      TransferEncoding encoding = TransferEncoding.bodyEncoding(encodingName);
      ByteBuffer decodedBytes = encoding.decode(bytes);
      text = bodyCharset.decode(decodedBytes).toString();
    }
    catch (Exception e) {
      text = bodyCharset.decode(bytes).toString();
    }
View Full Code Here

TOP

Related Classes of plugins.Freetalk.ui.NNTP.MIME.TransferEncoding

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.