def unicodise(string, encoding=None, errors='replace'):
 if (not encoding):
  encoding = S3.Config.Config().encoding
 if (type(string) == unicode):
  return string
 debug(('Unicodising %r using %s' % (string, encoding)))
 try:
  return unicode(string, encoding, errors)
 except UnicodeDecodeError:
  raise UnicodeDecodeError(('Conversion to unicode failed: %r' % string))

def unicodise ( string , encoding = None , errors = 'replace' ) : if ( not encoding ) : encoding = S3 . Config . Config ( ) . encoding if ( type ( string ) == unicode ) : return string debug ( ( 'Unicodising %r using %s' % ( string , encoding ) ) ) try : return unicode ( string , encoding , errors ) except UnicodeDecodeError : raise UnicodeDecodeError ( ( 'Conversion to unicode failed: %r' % string ) )
convert string to unicode or raise an exception .