src/MailMap/MailFactory.php
protected static function convertBodyEncoding($body, $charset = '', $encoding = -1)
    {
        if ('' === $charset) {
            $charset = static::$charset;
        }

        if (!mb_check_encoding($body, $charset)) {
            $charset = mb_detect_encoding($body);
        }

        if ($charset === static::$charset) {
            return $body;
        }

        if (!in_array($charset, mb_list_encodings())) {
            $charset = $encoding === ENC7BIT ? 'US-ASCII' : static::$charset;
        }

        return mb_convert_encoding($body, static::$charset, $charset);
    }
protected static function convertBodyEncoding($body, $charset = '', $encoding = -1)
    {
        if ('' === $charset) {
            $charset = static::$charset;
        }

        if (!mb_check_encoding($body, $charset)) {
            $charset = mb_detect_encoding($body);
        }

        if ($charset === static::$charset) {
            return $body;
        }

        if (!in_array($charset, mb_list_encodings())) {
            $charset = $encoding === ENC7BIT ? 'US-ASCII' : static::$charset;
        }

        return mb_convert_encoding($body, static::$charset, $charset);
    }
protected static function convertBodyEncoding ( $ body , $ charset = '' , $ encoding = - 1 ) { if ( '' === $ charset ) { $ charset = static :: $ charset ; } if ( ! mb_check_encoding ( $ body , $ charset ) ) { $ charset = mb_detect_encoding ( $ body ) ; } if ( $ charset === static :: $ charset ) { return $ body ; } if ( ! in_array ( $ charset , mb_list_encodings ( ) ) ) { $ charset = $ encoding === ENC7BIT ? 'US-ASCII' : static :: $ charset ; } return mb_convert_encoding ( $ body , static :: $ charset , $ charset ) ; }
Convert body encoding from given coding to default

@param  string $body
@param  string $charset
@param  int $encoding
@return string
Convert body encoding from given coding to default