private function getNormalizedCharset($charset)
    {
        $upper = null;
        if (is_array($charset)) {
            $upper = array_map('strtoupper', $charset);
        } else {
            $upper = strtoupper($charset);
        }
        return preg_replace('/[^A-Z0-9]+/', '', $upper);
    }