com.jscape.inet.mime

## Class RFC2047Encoder

- java.lang.Object
- - com.jscape.inet.mime.RFC2047Encoder

-     public class RFC2047Encoder
      extends java.lang.Object

  Implements methods for encoding and decoding non-ASCII header data in a `MimeMessage`. Encoding and decoding is performed according to standards defined in RFC 2047.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.lang.String` | `decode(java.lang.String value)` Decodes data according to RFC 2047.
    `static java.lang.String` | `encode(java.lang.String data, java.lang.String characterEncoding, int offset)` Encodes data according to RFC 2047.
    `static java.lang.String` | `getDecodedValue(java.lang.String value)` Get decoded value.
    `static java.lang.String` | `getDecodedWord(java.lang.String word)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### encode

          public static java.lang.String encode(java.lang.String data,
                                                java.lang.String characterEncoding,
                                                int offset)
                                         throws java.io.UnsupportedEncodingException

      Encodes data according to RFC 2047.
      Parameters:
        `data` - the data to encode
        `characterEncoding` - the character encoding to use
        `offset` - the number of characters to offset when calculating maximum line length of 72 characters if MIME header folding is used.
      Returns:
        encoded data
      Throws:
        `java.io.UnsupportedEncodingException` - if character encoding is invalid

    - #### getDecodedValue

          public static java.lang.String getDecodedValue(java.lang.String value)

      Get decoded value.
      Parameters:
        `value` -
      Returns:
        decoded value

    - #### getDecodedWord

          public static java.lang.String getDecodedWord(java.lang.String word)

    - #### decode

          public static java.lang.String decode(java.lang.String value)
                                         throws java.io.UnsupportedEncodingException

      Decodes data according to RFC 2047.
      Parameters:
        `value` - the data to decode
      Returns:
        the decoded data
      Throws:
        `java.io.UnsupportedEncodingException` - if unable to decode due to invalid character encoding

Copyright © JSCAPE LLC. 1999-2021. All Rights Reserved