vuntz / maildir-to-ics

4 stars 2 forks source link

fix crash writing ics files to disk #13

Closed aspiers closed 8 years ago

aspiers commented 8 years ago

Fix a crash if the vevent contained non-ascii characters (e.g. in the DESCRIPTION field):

Traceback (most recent call last):
  File "/home/adam/bin/maildir-to-ics", line 898, in <module>
    ret = main(sys.argv)
  File "/home/adam/bin/maildir-to-ics", line 876, in main
    dest_ics, limit_past, limit_future)
  File "/home/adam/bin/maildir-to-ics", line 578, in write_ics_from_dir
    fp.write(buf)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 2912: ordinal not in range(128)
aspiers commented 8 years ago

Hmm, this fixes STDOUT but breaks --ics.