Merge branch 'fix-UnicodeEncodeError'

pull/42/head
carloshanson 2019-01-23 15:28:19 -08:00
commit 1ecb734fbd
1 zmienionych plików z 8 dodań i 2 usunięć

Wyświetl plik

@ -140,8 +140,14 @@ def create_event(component, tz=UTC):
else: # compute implicit end as start + 0 else: # compute implicit end as start + 0
event.end = event.start event.end = event.start
event.summary = str(component.get('summary')) try:
event.description = str(component.get('description')) event.summary = str(component.get('summary'))
except UnicodeEncodeError as e:
event.summary = str(component.get('summary').encode('utf-8'))
try:
event.description = str(component.get('description'))
except UnicodeEncodeError as e:
event.description = str(component.get('description').encode('utf-8'))
event.all_day = type(component.get('dtstart').dt) is date event.all_day = type(component.get('dtstart').dt) is date
if component.get('rrule'): if component.get('rrule'):
event.recurring = True event.recurring = True