diff --git a/README.txt b/README.txt index 46fe4c7..a5e35f8 100755 --- a/README.txt +++ b/README.txt @@ -318,7 +318,7 @@ Index attributes adapter >>> from loops.resource import IndexAttributes >>> idx = IndexAttributes(doc1) >>> idx.text() - '' + u'' >>> idx.title() u'doc1 Zope Info' diff --git a/resource.py b/resource.py index b251565..38373db 100644 --- a/resource.py +++ b/resource.py @@ -237,8 +237,10 @@ class IndexAttributes(object): def text(self): context = self.context if not context.contentType.startswith('text'): - return '' + return u'' data = context.data + if type(data) != unicode: + data = data.decode('UTF-8') # TODO: transform to plain text #return ' '.join((zapi.getName(context), context.title, data)).strip() return data