Your 'default' LoadFile / SaveFile functions (where encoding is not specified) say they save/load UTF8 format.
However if I use SaveFile to save a file that contains european accented characters (in the x'80' to x'FF' range) it does in deed save those characters using UTF8 encoding, but it does not include the UTF8 BOM.
If I open the file in Notepad everything works fine, but if I open it using your default LoadFile() method the high range characters are loaded as though they were 2 'low range' ASCII characters. i.e. it screws up the data.
Since I work with a lot of european customers this is a major issue.
I originally got around the issue by always specifying a UTF8 encoding - which does write the BOM on the file.
However customers want to be able to open the files on non-Windows systems that do not understand a Windows BOM, so they want the files to be saved as ANSI (i.e. the current code page) unless those files contain characters that are not in the current code page. In which case we would save as UTF8 - but with a BOM.
This is exactly how the default SaveFile() function in my previous tool worked... and appears to be how Notepad works.
You do not apparently have a version of SaveFile that can do this so my real question is whether you have a method that can examine the text and tell me if it contains any characters that are not in the current code page, so that I can do this myself.
(I would also ask that you consider changing your default SaveFile() function, or add an additional overload, that works in this 'standard' fashion.)