From: Ken Hornstein Date: Thu, 31 Oct 2013 15:51:52 +0000 (-0400) Subject: Beginning stubs to support base64 header encoding. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/b6fff86c5a551eb0723ff48ca56c653b74dbedf1?ds=inline;hp=--cc Beginning stubs to support base64 header encoding. --- b6fff86c5a551eb0723ff48ca56c653b74dbedf1 diff --git a/sbr/encode_rfc2047.c b/sbr/encode_rfc2047.c index 33ed5d87..2929db1c 100644 --- a/sbr/encode_rfc2047.c +++ b/sbr/encode_rfc2047.c @@ -44,6 +44,7 @@ static char *address_headers[] = { static void unfold_header(char **, int); static int field_encode_address(const char *, char **, int, const char *); static int field_encode_quoted(const char *, char **, const char *, int, int); +static int field_encode_base64(const char *, char **, const char *); static int utf8len(const char *); /* @@ -126,10 +127,8 @@ encode_rfc2047(const char *name, char **value, int encoding, switch (encoding) { -#if 0 case CE_BASE64: - return field_encode_base64(name, value, encoding, charset); -#endif + return field_encode_base64(name, value, charset); case CE_QUOTED: return field_encode_quoted(name, value, charset, asciicount, @@ -142,7 +141,7 @@ encode_rfc2047(const char *name, char **value, int encoding, } /* - * Encode our specified header using quoted-printable + * Encode our specified header (or field) using quoted-printable */ static int @@ -280,6 +279,19 @@ field_encode_quoted(const char *name, char **value, const char *charset, return 0; } +/* + * Encode our specified header (or field) using base64. + * + * This is a little easier since every character gets encoded, we can + * calculate the line wrap up front. + */ + +static int +field_encode_base64(const char *name, char **value, const char *encoding) +{ + return 0; +} + /* * Calculate the length of a UTF-8 character. *