Vendor/langcode-conv/zendframework/zend-filter/src/AbstractUnicode.php
public function setEncoding($encoding = null)
    {
        if ($encoding !== null) {
            if (!function_exists('mb_strtolower')) {
                throw new Exception\ExtensionNotLoadedException(sprintf(
                    '%s requires mbstring extension to be loaded',
                    get_class($this)
                ));
            }

            $encoding    = strtolower($encoding);
            $mbEncodings = array_map('strtolower', mb_list_encodings());
            if (!in_array($encoding, $mbEncodings)) {
                throw new Exception\InvalidArgumentException(sprintf(
                    "Encoding '%s' is not supported by mbstring extension",
                    $encoding
                ));
            }
        }

        $this->options['encoding'] = $encoding;
        return $this;
    }
public function setEncoding($encoding = null)
    {
        if ($encoding !== null) {
            if (!function_exists('mb_strtolower')) {
                throw new Exception\ExtensionNotLoadedException(sprintf(
                    '%s requires mbstring extension to be loaded',
                    get_class($this)
                ));
            }

            $encoding    = strtolower($encoding);
            $mbEncodings = array_map('strtolower', mb_list_encodings());
            if (!in_array($encoding, $mbEncodings)) {
                throw new Exception\InvalidArgumentException(sprintf(
                    "Encoding '%s' is not supported by mbstring extension",
                    $encoding
                ));
            }
        }

        $this->options['encoding'] = $encoding;
        return $this;
    }
public function setEncoding ( $ encoding = null ) { if ( $ encoding !== null ) { if ( ! function_exists ( 'mb_strtolower' ) ) { throw new Exception \ ExtensionNotLoadedException ( sprintf ( '%s requires mbstring extension to be loaded' , get_class ( $ this ) ) ) ; } $ encoding = strtolower ( $ encoding ) ; $ mbEncodings = array_map ( 'strtolower' , mb_list_encodings ( ) ) ; if ( ! in_array ( $ encoding , $ mbEncodings ) ) { throw new Exception \ InvalidArgumentException ( sprintf ( "Encoding '%s' is not supported by mbstring extension" , $ encoding ) ) ; } } $ this -> options [ 'encoding' ] = $ encoding ; return $ this ; }
Set the input encoding for the given string

@param  string|null $encoding
@return self
@throws Exception\InvalidArgumentException
@throws Exception\ExtensionNotLoadedException
Set the input encoding for the given string