correct badly encoded data (optional)