When you open the file and save it. The file may replace some settings with your IDE settings. Encoding?
Yes, that is a likely explanation. Another possibilities are:
- Removing trailing spaces.
- Replacing tabs with spaces.
- Changing newlines to CR-LF.
- Adding missing line break at the end.
Rather saving the file over the old file that does not work, save to a new file and verifies that it works. Then use a comparison tool find out the difference. I would recommend Beyond Compare. No, I am no way affiliated with them, but I'm a very happy user of Beyond Compare. The have comparisons for all sorts of files - including binary.