def parse_ext_value(val):
 if (len(val) == 3):
  (charset, langtag, coded) = val
 else:
  (charset, coded) = val
  langtag = None
 decoded = urllib.parse.unquote(coded, charset, errors='strict')
 if (charset == 'iso-8859-1'):
  for c in decoded:
   if (127 <= ord(c) <= 159):
    raise InvalidISO8859Error(c)
 return LangTagged(decoded, langtag)

def parse_ext_value ( val ) : if ( len ( val ) == 3 ) : ( charset , langtag , coded ) = val else : ( charset , coded ) = val langtag = None decoded = urllib . parse . unquote ( coded , charset , errors = 'strict' ) if ( charset == 'iso-8859-1' ) : for c in decoded : if ( 127 <= ord ( c ) <= 159 ) : raise InvalidISO8859Error ( c ) return LangTagged ( decoded , langtag )
parse the value of an extended attribute .