MIME encoding MIME defines a number of encodings that serve to represent 8-bit data in 7 bits. For the meaning of the encodings, see elsewhere. [[MIME_8bit]] and [[MIME_7bit]] essentially means `no encoding'. The default is [[MIME_8bit]]. The function [[lookup_encoding()]] translates a string to the [[MIME_encoding]] enumerated type. <<*>>= #include #include EXPORT typedef enum { MIME_8bit, MIME_7bit, MIME_quoted_printable, MIME_base64, MIME_x_gzip, } MIME_encoding; EXPORT MIME_encoding lookup_encoding(char *s) { if (case_eq(s, "7bit")) return MIME_7bit; if (case_eq(s, "8bit")) return MIME_8bit; if (case_eq(s, "quoted-printable")) return MIME_quoted_printable; if (case_eq(s, "base64")) return MIME_base64; if (case_eq(s, "x-gzip")) return MIME_x_gzip; return MIME_8bit; }