Encodes MIME/HTTP header values that contain incorrectly encoded characters.
$string: The header to encode.
string The mime-encoded header.
\Drupal\Component\Utility\Unicode::mimeHeaderEncode().
function mime_header_encode($string) {
return Unicode::mimeHeaderEncode($string);
}