MIMEHEADER_ENCODE v13

Use the MIMEHEADER_ENCODE function to convert a string into mime header format, and then encode the string. The signature is:

MIMEHEADER_ENCODE(<buf> IN VARCHAR2, <encode_charset> IN VARCHAR2
DEFAULT NULL, <encoding> IN INTEGER DEFAULT NULL)

This function returns a VARCHAR2 value.

Parameters

buf

buf contains the string that will be formatted and encoded. The string is a VARCHAR2 value.

encode_charset

encode_charset specifies the character set to which the string will be converted before being formatted and encoded. The default value is NULL.

encoding

encoding specifies the encoding type used when encoding the string. You can specify:

  • Q to enable quoted-printable encoding. If you do not specify a value, MIMEHEADER_ENCODE will use quoted-printable encoding.
  • B to enable base-64 encoding.

Examples

The following examples use the MIMEHEADER_ENCODE and MIMEHEADER_DECODE functions to first encode, and then decode a string:

edb=# SELECT UTL_ENCODE.MIMEHEADER_ENCODE('What is the date?') FROM DUAL;
      mimeheader_encode
------------------------------
 =?UTF8?Q?What is the date??=
(1 row)

edb=# SELECT UTL_ENCODE.MIMEHEADER_DECODE('=?UTF8?Q?What is the date??=')
FROM DUAL;
 mimeheader_decode
-------------------
 What is the date?
(1 row)