def fix_alpha2_value(alpha2):
    """Return a fixed two-letter uppercase alpha2, or None if unfixable."""
    if alpha2 is None:
        return None

    fixed_alpha2 = alpha2.strip()
    if not fixed_alpha2.isalpha():
        return None

    fixed_alpha2 = fixed_alpha2.upper()
    assert len(fixed_alpha2) == 2
    return fixed_alpha2