def _decode_unicode(value, charset, errors):
 fallback = None
 if errors.startswith('fallback:'):
  fallback = errors[9:]
  errors = 'strict'
 try:
  return value.decode(charset, errors)
 except UnicodeError as e:
  if (fallback is not None):
   return value.decode(fallback, 'replace')
  from werkzeug.exceptions import HTTPUnicodeError
  raise HTTPUnicodeError(str(e))

def _decode_unicode ( value , charset , errors ) : fallback = None if errors . startswith ( 'fallback:' ) : fallback = errors [ 9 : ] errors = 'strict' try : return value . decode ( charset , errors ) except UnicodeError as e : if ( fallback is not None ) : return value . decode ( fallback , 'replace' ) from werkzeug . exceptions import HTTPUnicodeError raise HTTPUnicodeError ( str ( e ) )
like the regular decode function but this one raises an httpunicodeerror if errors is strict .