def _is_ascii_encoding(encoding):
 if (encoding is None):
  return False
 try:
  return (codecs.lookup(encoding).name == 'ascii')
 except LookupError:
  return False

def _is_ascii_encoding ( encoding ) : if ( encoding is None ) : return False try : return ( codecs . lookup ( encoding ) . name == 'ascii' ) except LookupError : return False
given an encoding this figures out if the encoding is actually ascii .