Add test for _get_attachment_text_internal with invalid utf-8