BTW, a workaround for getting a more correct value before this bug is resolved could be using Scintilla's [`SCI_GETMODIFY`](https://scintilla.org/ScintillaDoc.html#SCI_GETMODIFY): I would think it should be reliable but for encoding changes (enabling/disabling BOM, choosing another encoding to save the file, etc.), which although relevant are a lot less common.