add workaround some transformation bug

This commit is contained in:
Frédéric Péters 2011-11-30 21:48:29 +01:00
parent 6d9733430a
commit 2aba26916e
1 changed files with 6 additions and 0 deletions

View File

@ -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 &nbsp 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')