def deunicodise(string, encoding=None, errors='replace'):
 if (not encoding):
  encoding = S3.Config.Config().encoding
 if (type(string) != unicode):
  return str(string)
 debug(('DeUnicodising %r using %s' % (string, encoding)))
 try:
  return string.encode(encoding, errors)
 except UnicodeEncodeError:
  raise UnicodeEncodeError(('Conversion from unicode failed: %r' % string))

def deunicodise ( string , encoding = None , errors = 'replace' ) : if ( not encoding ) : encoding = S3 . Config . Config ( ) . encoding if ( type ( string ) != unicode ) : return str ( string ) debug ( ( 'DeUnicodising %r using %s' % ( string , encoding ) ) ) try : return string . encode ( encoding , errors ) except UnicodeEncodeError : raise UnicodeEncodeError ( ( 'Conversion from unicode failed: %r' % string ) )
convert unicode string to <type str> .