If you set a callback function to be called when you try to save a file in ANSI encoding format and from this callback you cancel saving, your pre-existing file will be truncated.
This happens because the SaveToFile method creates a FileStream (truncating it's previous content) and then calls SaveToStream, but the callback is only called from SaveToStream.
The attached patch tries to fix this.
Hope it helps.
Log in to post a comment.