fix encoding issue with manual editing and saving