def _try_decode(byte_string):
 try:
  return str_cls(byte_string, _encoding)
 except UnicodeDecodeError:
  for encoding in _fallback_encodings:
   try:
    return str_cls(byte_string, encoding, errors=u'strict')
   except UnicodeDecodeError:
    pass
 return str_cls(byte_string, errors=u'replace')

def _try_decode ( byte_string ) : try : return str_cls ( byte_string , _encoding ) except UnicodeDecodeError : for encoding in _fallback_encodings : try : return str_cls ( byte_string , encoding , errors = u'strict' ) except UnicodeDecodeError : pass return str_cls ( byte_string , errors = u'replace' )
tries decoding a byte string from the os into a unicode string .