public function getEncoding()
    {
        $content = $this->getHeaderLine('content-type');
        if (!$content) {
            return null;
        }
        preg_match('/charset\s?=\s?[\'"]?([a-z0-9-_]+)[\'"]?/i', $content, $matches);
        if (empty($matches[1])) {
            return null;
        }

        return $matches[1];
    }
public function getEncoding()
    {
        $content = $this->getHeaderLine('content-type');
        if (!$content) {
            return null;
        }
        preg_match('/charset\s?=\s?[\'"]?([a-z0-9-_]+)[\'"]?/i', $content, $matches);
        if (empty($matches[1])) {
            return null;
        }

        return $matches[1];
    }
public function getEncoding ( ) { $ content = $ this -> getHeaderLine ( 'content-type' ) ; if ( ! $ content ) { return null ; } preg_match ( '/charset\s?=\s?[\'"]?([a-z0-9-_]+)[\'"]?/i' , $ content , $ matches ) ; if ( empty ( $ matches [ 1 ] ) ) { return null ; } return $ matches [ 1 ] ; }
Get the encoding if it was set.

@return string|null
Get the encoding if it was set .