fix  UnicodeEncodeError on text.baseindex.BaseIndex.document_repr()

Use unicode throughout.