From 2aba26916e7c982ad05a2dd88911cc9c8b23baa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Wed, 30 Nov 2011 21:48:29 +0100 Subject: [PATCH] add workaround some transformation bug --- tabellio/icalimport/icalimport.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tabellio/icalimport/icalimport.py b/tabellio/icalimport/icalimport.py index 11b4cba..74b2245 100644 --- a/tabellio/icalimport/icalimport.py +++ b/tabellio/icalimport/icalimport.py @@ -88,6 +88,12 @@ class IcalImport(BrowserView): description = vevent.x_alt_desc.value except: pass + if description and type(description) is unicode: + # there's some bug in the transformation chain that will at + # the wrong time convert the   and turn it into an invalid + # utf-8 character, therefore we replace all of them right now, + # as it's safe to do. + description = description.replace(' ', u'\xa0') if description: event.text = RichTextValue(raw=description, mimeType='text/html', outputMimeType='text/x-html-safe')