public function detectEncoding($string)
    {
        $encoding = $this->pool->encodingService->mbDetectEncoding($string);

        // We need to decide, if we need to change the official encoding of
        // the HTML output with a meta tag. We ignore everything in the
        // doNothingEncoding array.
        if (in_array($encoding, $this->doNothingEncoding, true) === false) {
            $this->officialEncoding = $encoding;
        }
    }