public function setEncoding($encoding = null)
    {
        if ($encoding !== null) {
            if (!function_exists('mb_strtoupper')) {

                throw new Zend_Filter_Exception('mbstring is required for this feature');
            }

            $encoding = (string) $encoding;
            if (!in_array(strtolower($encoding), array_map('strtolower', mb_list_encodings()))) {

                throw new Zend_Filter_Exception("The given encoding '$encoding' is not supported by mbstring");
            }
        }

        $this->_encoding = $encoding;
        return $this;
    }
public function setEncoding($encoding = null)
    {
        if ($encoding !== null) {
            if (!function_exists('mb_strtoupper')) {

                throw new Zend_Filter_Exception('mbstring is required for this feature');
            }

            $encoding = (string) $encoding;
            if (!in_array(strtolower($encoding), array_map('strtolower', mb_list_encodings()))) {

                throw new Zend_Filter_Exception("The given encoding '$encoding' is not supported by mbstring");
            }
        }

        $this->_encoding = $encoding;
        return $this;
    }
public function setEncoding ( $ encoding = null ) { if ( $ encoding !== null ) { if ( ! function_exists ( 'mb_strtoupper' ) ) { throw new Zend_Filter_Exception ( 'mbstring is required for this feature' ) ; } $ encoding = ( string ) $ encoding ; if ( ! in_array ( strtolower ( $ encoding ) , array_map ( 'strtolower' , mb_list_encodings ( ) ) ) ) { throw new Zend_Filter_Exception ( "The given encoding '$encoding' is not supported by mbstring" ) ; } } $ this -> _encoding = $ encoding ; return $ this ; }
Set the input encoding for the given string

@param  string $encoding
@return Zend_Filter_StringToUpper Provides a fluent interface
@throws Zend_Filter_Exception
Set the input encoding for the given string