mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2025-01-31 21:11:39 +01:00
Fixed some issues with "Save original as..." - thx Stefan :)
This commit is contained in:
parent
76376141f8
commit
a7b24f6eca
@ -9,6 +9,7 @@
|
||||
* Updated Romanian translation - thx Mircea
|
||||
* Updated Finnish translation - thx Teijo
|
||||
* Updated French Translation - thx JM GBT
|
||||
* Updated Bulgarian Translation - thx Maknol
|
||||
* Language auto-detect now includes Latvian and Lithuanian - thx rhazor
|
||||
* FIXED:
|
||||
* Fixed possible crash when generating scene changes - thx Leemet
|
||||
@ -23,6 +24,7 @@
|
||||
* Fix "Fix missing spaces" issue regarding Finnish/Swedish colons - thx Boulder08
|
||||
* Fix two issues with "Fix common errors" - thx Tronar
|
||||
* OCR fix rules: fix for weird Unicode comma (#x201A) - thx djc
|
||||
* Fixed some issues with "Save original as..." - thx Stefan
|
||||
|
||||
|
||||
3.5 (26th October 2016)
|
||||
|
@ -3468,19 +3468,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
try
|
||||
{
|
||||
var subAlt = GetSaveSubtitle(_subtitleAlternate);
|
||||
string allText = subAlt.ToText(format).Trim();
|
||||
var currentEncoding = GetCurrentEncoding();
|
||||
bool isUnicode = currentEncoding == Encoding.Unicode || currentEncoding == Encoding.UTF32 || currentEncoding == Encoding.UTF7 || currentEncoding == Encoding.UTF8;
|
||||
if (!isUnicode && (allText.Contains(new[] { '♪', '♫', '♥', '—', '―', '…' }))) // ANSI & music/unicode symbols
|
||||
{
|
||||
if (MessageBox.Show(string.Format(_language.UnicodeMusicSymbolsAnsiWarning), Title, MessageBoxButtons.YesNo) == DialogResult.No)
|
||||
return DialogResult.No;
|
||||
}
|
||||
|
||||
if (!isUnicode)
|
||||
{
|
||||
allText = NormalizeUnicode(allText);
|
||||
}
|
||||
|
||||
bool containsNegativeTime = false;
|
||||
foreach (var p in subAlt.Paragraphs)
|
||||
@ -3497,6 +3484,38 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
return DialogResult.No;
|
||||
}
|
||||
|
||||
if (format != null && !format.IsTextBased)
|
||||
{
|
||||
var ebu = format as Ebu;
|
||||
if (ebu != null)
|
||||
{
|
||||
if (ebu.Save(_subtitleAlternateFileName, subAlt))
|
||||
{
|
||||
Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex, _videoFileName, _subtitleAlternateFileName, Configuration.Settings.General.CurrentVideoOffsetInMs);
|
||||
Configuration.Settings.Save();
|
||||
ShowStatus(string.Format(_language.SavedOriginalSubtitleX, _subtitleAlternateFileName));
|
||||
_changeAlternateSubtitleToString = _subtitleAlternate.ToText(new SubRip()).Trim();
|
||||
return DialogResult.OK;
|
||||
}
|
||||
return DialogResult.No;
|
||||
}
|
||||
MessageBox.Show("Ups - save original does not support this format - please go to Github and create an issue!");
|
||||
}
|
||||
|
||||
string allText = subAlt.ToText(format).Trim();
|
||||
var currentEncoding = GetCurrentEncoding();
|
||||
bool isUnicode = currentEncoding != null && (currentEncoding == Encoding.Unicode || currentEncoding == Encoding.UTF32 || currentEncoding == Encoding.UTF7 || currentEncoding == Encoding.UTF8);
|
||||
if (!isUnicode && (allText.Contains(new[] { '♪', '♫', '♥', '—', '―', '…' }))) // ANSI & music/unicode symbols
|
||||
{
|
||||
if (MessageBox.Show(string.Format(_language.UnicodeMusicSymbolsAnsiWarning), Title, MessageBoxButtons.YesNo) == DialogResult.No)
|
||||
return DialogResult.No;
|
||||
}
|
||||
|
||||
if (!isUnicode)
|
||||
{
|
||||
allText = NormalizeUnicode(allText);
|
||||
}
|
||||
|
||||
File.WriteAllText(_subtitleAlternateFileName, allText, currentEncoding);
|
||||
ShowStatus(string.Format(_language.SavedOriginalSubtitleX, _subtitleAlternateFileName));
|
||||
_changeAlternateSubtitleToString = _subtitleAlternate.ToText(new SubRip()).Trim();
|
||||
@ -17311,6 +17330,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
_subtitleAlternateFileName = saveFileDialog1.FileName;
|
||||
SaveOriginalSubtitle(GetCurrentSubtitleFormat());
|
||||
SetTitle();
|
||||
Configuration.Settings.RecentFiles.Add(_fileName, FirstVisibleIndex, FirstSelectedIndex, _videoFileName, _subtitleAlternateFileName, Configuration.Settings.General.CurrentVideoOffsetInMs);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user