php Function Mb_Decode_Mimeheader
Article about php function mb_decode_mimeheader:
The inbuilt mb_decode_mimeheader() decodes encoded-word string str in MIME header. It returns the decoded string in internal character encoding.
MIME (Multipurpose Internet Mail Extensions) defines a set of rules for the encoding of text within email messages. For example, it allows you to include non-ASCII text in some of the header fields such as From, To, Cc and Bcc, as well as the subject line.
In order to send such messages, the email client must be able to read the MIME content. This means that the header field must be encoded using one of the schemes defined in RFC 2047. The most common ones are
To encode the header field, you can use mb_encode_mimeheader(). The function takes two parameters, charset and transfer-encoding. charset specifies the character encoding name. The default value is ISO-2022-JP. The transfer-encoding should be either
It is possible to skip the mb_decode_mimeheader() and directly use the encode_header() function, if a multibyte character set is supported by mbstring (e.g., utf-8). However, this approach is less convenient because it does not support the Q encoding, and it can cause E_USER_NOTICE errors in some cases (see FAQ entry below). If you use the latter option, you should set the mbstring.internal_encoding variable to the same value as the charset specified in your mb_decode_mimeheader() call.