rfc2047_utf8_decode — Decode rfc2047 encoding, returning a string that is utf-8 encoded
char * **rfc2047_utf8_decode** ( | header, | |
| | hdrlen, | |
| | outlen, | |
| | needs_free
); | |
Decode rfc2047 encoding, returning a string that is utf-8 encoded.
needs_free parameter indicates whether or not this function has allocated memory. If this function does allocate memory, it is of the
MEMTYPE_MESSAGE_BODY type. For more information about memory types see ec_malloc.
The header to be decoded.
The length of the header in bytes.
outlenis not NULL, the integer it points to will be updated to hold the length of the returned string.
needs_freeis a NULL pointer, you are always responsible for freeing the returned buffer. Free the returned buffer using ec_free. If
needs_freepoints to an integer, that integer will be set to
1if the call allocated memory for the returned string (which happens when the header is encoded), but
0if it did not (which happens when the header is not encoded).
If the header needs decoding, this function returns the decoded header.
It is legal to call this function in any thread.