def uniconvert(s, enc):
 if (not isinstance(s, unicode)):
  try:
   s = bin2unicode(s, enc)
  except UnicodeError:
   raise UnicodeError(('bad filename: ' + s))
 return s.encode(enc)

def uniconvert ( s , enc ) : if ( not isinstance ( s , unicode ) ) : try : s = bin2unicode ( s , enc ) except UnicodeError : raise UnicodeError ( ( 'bad filename: ' + s ) ) return s . encode ( enc )
convert s to a string containing a unicode sequence encoded using encoding "enc" .