private void OnSaveAsWithEncoding()
        {
            var newEncoding = CodePageList[SelectedCodePageIndex];

            ShowCodePageList = false;
            bool isSaved = CurrentEditor?.SaveFile(saveAs: true, newEncoding: newEncoding.GetEncoding()) == true;

            if (isSaved)
            {
                CodePageChangedEvent?.Invoke();
                CurrentEditor.Load(CurrentEditor.CurrentFilePath);  // reload with new encoding
            }
        }