protected function findCharsetByBOM($bom)
    {
        foreach ($this->byteOrderMarks as $charset=>$knownBom) {
            if ($knownBom === $bom) {
                return $charset;
            }
        }

        return '';

    }