Fix UnicodeEncodeError on document_repr() of text index

Fix UnicodeEncodeError on text.baseindex.BaseIndex.document_repr()
when the indexed text contains non-ascii unicode.