I have a .idl file with some extended non-ASCII characters in the comments using Windows-1252 encoding. When I open it in the IDE editor I get an error message:
Some bytes have been replaced with the Unicode substitution character while loading file xxx.idl with Unicode (UTF-8) encoding. Saving the file will not preserve the original file contents.
Sure enough, the special characters have been replaced with the question mark in a black diamond.
When I do a compile, the file is automatically resaved with the garbage characters in it. The characters are only in comments, so everything compiles just fine, but the comments are ruined. The source control system notices the change and helpfully offers to check in the bad file, which would make the damage permanent.
I've tried to find a way to get Visual Studio to open the file with the proper encoding but haven't found a suitable setting anywhere. I found this Microsoft documentation /source-charset (Set Source Character Set) but apparently it only affects the compiler, not the editor.
Is there a setting, hopefully file-by-file but more globally would be OK too, where I can specify the character encoding?