def encoding_name(s):
    """Obtain 'br' out of ' br;q=0.5' or similar."""
    if ';' in s:
        s, q = s.split(';')
        if '=' in q:
            _, q = q.split('=')
            if float(q) == 0.0:
                return None
    return s.strip()
