Next: Mail body functions, Previous: Message modification queue, Up: Library [Contents][Index]
Encode text in accordance with RFC 2047. Optional arguments:
Encoding to use. Valid values are ‘quoted-printable’, or ‘Q’ (the default) and ‘base64’, or ‘B’.
Character set. By default ‘UTF-8’.
If the function is unable to encode the string, it raises the
exception e_failure
.
For example:
set string "Keld Jørn Simonsen <keld@dkuug.dk>" message_header_encode(string, "ISO-8859-1") ⇒ "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>"
text must be a header value encoded in accordance with RFC
2047. The function returns the decoded string. If the decoding fails,
it raises e_failure
exception. The optional argument
charset specifies the character set to use (default –
‘UTF-8’).
set string "=?ISO-8859-1?Q?Keld_J=F8rn_Simonsen?= <keld@dkuug.dk>" message_header_decode(string) ⇒ "Keld Jørn Simonsen <keld@dkuug.dk>"
If text is a “folded” multi-line RFC 2822 header value, unfold it. If text is a single-line string, return its unchanged copy.
For example, suppose that the message being processed contained the following header:
List-Id: Sent bugreports to <some-address@some.net>
Then, applying unfold
to its value24 will produce:
Sent bugreports to <some-address@some.net>