src/core/framework/core/3rdparty/ezcomponents/Mail/src/parser/parts/text_parser.php
public function finish()
    {
        $charset = "us-ascii"; // RFC 2822 default
        if ( isset( $this->headers['Content-Type'] ) )
        {
            preg_match( '/\s*charset\s?=\s?"?([^;"\s]*);?/',
                            $this->headers['Content-Type'],
                            $parameters );
            if ( count( $parameters ) > 0 )
            {
                $charset = strtolower( trim( $parameters[1], '"' ) );
            }
        }

        $encoding = strtolower( $this->headers['Content-Transfer-Encoding'] );
        if ( $encoding == ezcMail::QUOTED_PRINTABLE )
        {
            $this->text = quoted_printable_decode( $this->text );
        }
        else if ( $encoding == ezcMail::BASE64 )
        {
            $this->text = base64_decode( $this->text );
        }

        $this->text = ezcMailCharsetConverter::convertToUTF8( $this->text, $charset );

        $part = new ezcMailText( $this->text, 'utf-8', ezcMail::EIGHT_BIT, $charset );
        $part->subType = $this->subType;
        $part->setHeaders( $this->headers->getCaseSensitiveArray() );
        ezcMailPartParser::parsePartHeaders( $this->headers, $part );
        $part->size = strlen( $this->text );
        return $part;
    }
public function finish()
    {
        $charset = "us-ascii"; // RFC 2822 default
        if ( isset( $this->headers['Content-Type'] ) )
        {
            preg_match( '/\s*charset\s?=\s?"?([^;"\s]*);?/',
                            $this->headers['Content-Type'],
                            $parameters );
            if ( count( $parameters ) > 0 )
            {
                $charset = strtolower( trim( $parameters[1], '"' ) );
            }
        }

        $encoding = strtolower( $this->headers['Content-Transfer-Encoding'] );
        if ( $encoding == ezcMail::QUOTED_PRINTABLE )
        {
            $this->text = quoted_printable_decode( $this->text );
        }
        else if ( $encoding == ezcMail::BASE64 )
        {
            $this->text = base64_decode( $this->text );
        }

        $this->text = ezcMailCharsetConverter::convertToUTF8( $this->text, $charset );

        $part = new ezcMailText( $this->text, 'utf-8', ezcMail::EIGHT_BIT, $charset );
        $part->subType = $this->subType;
        $part->setHeaders( $this->headers->getCaseSensitiveArray() );
        ezcMailPartParser::parsePartHeaders( $this->headers, $part );
        $part->size = strlen( $this->text );
        return $part;
    }
public function finish ( ) { $ charset = "us-ascii" ; // RFC 2822 default if ( isset ( $ this -> headers [ 'Content-Type' ] ) ) { preg_match ( '/\s*charset\s?=\s?"?([^;"\s]*);?/' , $ this -> headers [ 'Content-Type' ] , $ parameters ) ; if ( count ( $ parameters ) > 0 ) { $ charset = strtolower ( trim ( $ parameters [ 1 ] , '"' ) ) ; } } $ encoding = strtolower ( $ this -> headers [ 'Content-Transfer-Encoding' ] ) ; if ( $ encoding == ezcMail :: QUOTED_PRINTABLE ) { $ this -> text = quoted_printable_decode ( $ this -> text ) ; } else if ( $ encoding == ezcMail :: BASE64 ) { $ this -> text = base64_decode ( $ this -> text ) ; } $ this -> text = ezcMailCharsetConverter :: convertToUTF8 ( $ this -> text , $ charset ) ; $ part = new ezcMailText ( $ this -> text , 'utf-8' , ezcMail :: EIGHT_BIT , $ charset ) ; $ part -> subType = $ this -> subType ; $ part -> setHeaders ( $ this -> headers -> getCaseSensitiveArray ( ) ) ; ezcMailPartParser :: parsePartHeaders ( $ this -> headers , $ part ) ; $ part -> size = strlen ( $ this -> text ) ; return $ part ; }
Returns the ezcMailText part corresponding to the parsed message.

@return ezcMailText
Returns the ezcMailText part corresponding to the parsed message .