+ try:
+ oldcal = unicode(oldcal, encoding)
+ oldcal = oldcal.replace('\r\n ', '').replace('\r\n\t','')
+ except UnicodeDecodeError:
+ # This is probably a file with badly folded lines
+ oldcal = oldcal.replace('\r\n ', '').replace('\r\n\t','')
+ try: oldcal = unicode(oldcal, encoding)
+ except UnicodeDecodeError:
+ sys.stderr.write('Malformed File')
+ raise