Hunny Software Library Reference

EncodedWord Class

Class that represents an encoded-word in a header field.

For a list of all members of this type, see EncodedWord Members.

System.Object
   Node
      EncodedWord

[Visual Basic]
Public Class EncodedWord
Inherits Node
[C#]
public class EncodedWord : Node

Remarks

EncodedWord represents an encoded word in a non-structured header field. In Internet email, and in MIME, only 7-bit ASCII characters are allowed in the header fields. RFC 2047 describes the method by which non-ASCII text can be encoded and inserted into certain header fields. In Hunny MIME.NET, EncodedWord represents a segment of encoded text and performs the encoding/decoding.

Encoded words have a charset identifier attribute, such as ISO-8859-1, and a transfer encoding type, which can be quoted-printable or base64. EncodedWord provides methods to set or get the charset identifier and the transfer encoding type. The charset identifier must be an identifier registered with the Internet Assigned Numbers Authority (IANA). The transfer encoding type must be either quoted-printable (the 'Q' encoding) or base64 (the 'B' encoding).

EncodedWord also contains strings for the decoded text and the entire encoded word. Use the inherited property Node.String to set or get the text of the entire encoded word.

To use EncodedWord to decode an encoded word, set the encoded word string using either the constructor EncodedWord(ByteString) or by setting the inherited Node.String property. Then call Parse(). You can then get the charset identifier and the decoded text.

To use EncodedWord to encode non-ASCII text, set the non-ASCII text by setting the DecodedText property. Also set the charset identifier and the encoding type by setting the Charset and EncodingType properties. Then call Assemble(). You can then get the encoded word by retrieving the inherited method Node.String property.

Because encoded words can be mixed with unencoded ASCII text, Hunny MIME.NET provides pseudo-encoded words, which are treated like encoded words but are not really encoded. If the encoding type of an EncodedWord is the NUL character, then no encoding or decoding is done. Other than the fact that no encoding is done, such pseudo-encoded words can be treated exactly like regular encoded words.

If there is an error decoding an encoded word, EncodedWord will present the entire encoded word as the decoded text.

Requirements

Namespace: Hunny.Mime

Assembly: Hunny.Mime (in Hunny.Mime.dll)

See Also

EncodedWord Members | Hunny.Mime Namespace