]>
diplodocus.org Git - nmh/blob - sbr/encode_rfc2047.c
ff77ff52a0c419730f92cc67c40cdbbdeb938a29
2 * Routines to encode message headers using RFC 2047-encoding.
4 * This code is Copyright (c) 2002, by the authors of nmh. See the
5 * COPYRIGHT file in the root directory of the nmh distribution for
6 * complete copyright information.
12 * Encode a message header using RFC 2047 encoding. We make the assumption
13 * that all characters < 128 are ASCII and as a consequence don't need any
18 encode_rfc2047(const char *name
, char **value
, int encoding
,
24 * First, check to see if we even need to encode the header
27 for (p
= *value
; *p
!= '\0'; p
++) {
28 if (! isascii((int) *p
)
36 * Some rules from RFC 2047:
38 * - Encoded words cannot be more than 75 characters long
39 * - Multiple "long" encoded words must be on new lines.
41 * Also, we're not permitted to encode email addresses, so
42 * we need to actually _parse_ email addresses and only encode