public static function encode($str, $encoding, $EOL = self::LINEEND)
    {
        switch ($encoding) {
            case self::ENCODING_BASE64:
                return self::encodeBase64($str, self::LINELENGTH, $EOL);

            case self::ENCODING_QUOTEDPRINTABLE:
                return self::encodeQuotedPrintable($str, self::LINELENGTH, $EOL);

            default:
                /**
                 * @todo 7Bit and 8Bit is currently handled the same way.
                 */
                return $str;
        }
    }
public static function encode($str, $encoding, $EOL = self::LINEEND)
    {
        switch ($encoding) {
            case self::ENCODING_BASE64:
                return self::encodeBase64($str, self::LINELENGTH, $EOL);

            case self::ENCODING_QUOTEDPRINTABLE:
                return self::encodeQuotedPrintable($str, self::LINELENGTH, $EOL);

            default:
                /**
                 * @todo 7Bit and 8Bit is currently handled the same way.
                 */
                return $str;
        }
    }
public static function encode ( $ str , $ encoding , $ EOL = self :: LINEEND ) { switch ( $ encoding ) { case self :: ENCODING_BASE64 : return self :: encodeBase64 ( $ str , self :: LINELENGTH , $ EOL ) ; case self :: ENCODING_QUOTEDPRINTABLE : return self :: encodeQuotedPrintable ( $ str , self :: LINELENGTH , $ EOL ) ; default : /**
                 * @todo 7Bit and 8Bit is currently handled the same way.
                 */ return $ str ; } }
Encode the given string with the given encoding.

@param string $str
@param string $encoding
@param string $EOL EOL string; defaults to {@link Zend_Mime::LINEEND}
@return string
Encode the given string with the given encoding .