[txt backend] Document::detectEncoding(): return QByteArray