399703 made encoding error handling consistent