public bool CanSaveWithCurrentEncoding() { if (encoding == null || Util.FileReader.IsUnicode(encoding)) return true; // not a unicode codepage string text = document.TextContent; return encoding.GetString(encoding.GetBytes(text)) == text; }