XCode needlessly modifies entire file


I'm using XCode 2.1 for a personal project. It seems that (in the text editor) sometimes after saving, XCode "forgets" what line endings the current file is using and saves the file with unix encodings, even if the file currently uses Windows endings. This makes for very annoying diffs.

Preferences are set to preserve line endings in existing files, but still it slips, quite frequently.

Does anyone know if there's a solution to this?