encoding documents with issues