encodeContent (NotesMIMEEntity - JavaScript)

Encodes the non-header content of a MIME entity.

Defined in

NotesMIMEEntity

Syntax

encodeContent(encoding:int) : void
Parameter Description
encoding The MIME transfer encoding, which should reflect the encoding of the input stream. This parameter generates a Content-Transfer-Encoding header. See encodeContent.
  • NotesMIMEEntity.ENC_BASE64 (1727) -- Content-Transfer-Encoding is "base64"
  • NotesMIMEEntity.ENC_EXTENSION (1731) -- Content-Transfer-Encoding is user-defined
  • NotesMIMEEntity.ENC_IDENTITY_7BIT (1728) -- Content-Transfer-Encoding is "7bit"
  • NotesMIMEEntity.ENC_IDENTITY_8BIT (1729) -- Content-Transfer-Encoding is "8bit"
  • NotesMIMEEntity.ENC_IDENTITY_BINARY (1730) -- Content-Transfer-Encoding is "binary"
  • NotesMIMEEntity.ENC_NONE (1725) -- no Content-Transfer-Encoding header
  • NotesMIMEEntity.ENC_QUOTED_PRINTABLE (1726) -- Content-Transfer-Encoding is "quoted-printable"

Usage

This method affects the non-header content of a MIME entity and the Content-Transfer-Encoding header as defined in RFC-2045.

Actual encoding of the content occurs only for ENC_BASE64 and ENC_QUOTED_PRINTABLE. Other options change the header but not the content. ENC_QUOTED_PRINTABLE affects only text content.

If the content is already encoded, no action occurs. You must decode the content first.

All options except ENC_NONE and ENC_EXTENSION establish a Content-Transfer-Encoding header.

Use getEncoding to get the current encoding.

Examples

This button changes the encoding for a one-part MIME entity to None. If the entity content is already encoded (base64 or quoted-printable), the agent first decodes the entity.
// Do not automatically convert MIME to rich text
session.setConvertMIME(false);
var doc:NotesDocument = currentDocument.getDocument();
var mime:NotesMIMEEntity = doc.getMIMEEntity();
if (mime != null) {
	mime.decodeContent();
	mime.encodeContent(NotesMIMEEntity.ENC_NONE);
	doc.save(true, true);
} else {
	requestScope.status = "Not MIME";
}
// Restore conversion
session.setConvertMIME(true);