private void OpenFile(FileInfo fi, Encoding enc = null) { if (enc == null && fi.Exists && !FileUtil.HasBom(fi)) { enc = UTF8EncodingNoBom.Instance; } else { enc = Encoding.UTF8; } var buffer = bufferManager.CreateBuffer(fi, enc); OpenBuffer(buffer); }