use standard function for decoding to unicode

git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@2746 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
helmutm 2008-07-09 08:19:19 +00:00
parent de8de38d44
commit 6496e7cc8d

View file

@ -437,7 +437,8 @@ class DocumentWriteFileAdapter(object):
#context = ti is None and self.context or ti(self.context)
context = adapted(self.context)
if ITextDocument.providedBy(context) or IDocument.providedBy(context):
context.data = unicode(data.replace('\r', ''), 'UTF-8')
#context.data = unicode(data.replace('\r', ''), 'UTF-8')
context.data = util.toUnicode(data.replace('\r', ''))
else:
# don't decode files or external files even if contentType == 'text/...'
# TODO: make use of tmpfile when using external files