Fixed handling of non-ascii member data, like fullname and email.

svn path=/plone.app.discussion/trunk/; revision=40789
This commit is contained in:
Hanno Schlichting
2010-10-22 10:14:07 +00:00
parent 54bbb08c62
commit aa8a1ea934
6 changed files with 21 additions and 10 deletions
+5
View File
@@ -172,6 +172,11 @@ class CommentForm(extensible.ExtensibleForm, form.Form):
fullname = member.getProperty('fullname')
if not fullname or fullname == '':
fullname = member.getUserName()
# memberdata is stored as utf-8 encoded strings
elif isinstance(fullname, str):
fullname = unicode(fullname, 'utf-8')
if email and isinstance(email, str):
email = unicode(email, 'utf-8')
comment.creator = fullname
comment.author_username = username
comment.author_name = fullname