diff --git a/src/Logic/SubtitleFormats/Sami.cs b/src/Logic/SubtitleFormats/Sami.cs index e143f0877..975d95e1a 100644 --- a/src/Logic/SubtitleFormats/Sami.cs +++ b/src/Logic/SubtitleFormats/Sami.cs @@ -43,9 +43,7 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats string language = Utilities.AutoDetectLanguageName("en_US", subtitle); var ci = CultureInfo.GetCultureInfo(language.Replace("_", "-")); string languageTag = string.Format("{0}CC", language.Replace("_", string.Empty).ToUpper()); - string languageName = ci.EnglishName; - if (ci.Parent != null) - languageName = ci.Parent.EnglishName; + string languageName = ci.Parent.EnglishName; string languageStyle = string.Format(".{0} [ name: {1}; lang: {2} ; SAMIType: CC ; ]", languageTag, languageName, language.Replace("_", "-")); languageStyle = languageStyle.Replace("[", "{").Replace("]", "}"); @@ -122,19 +120,21 @@ namespace Nikse.SubtitleEdit.Logic.SubtitleFormats bool tagOn = false; for (int i = 0; i < text.Length; i++) { - if (text.Substring(i).StartsWith("') && tagOn) + else if (t.StartsWith('>') && tagOn) { tagOn = false; totalLine.Append('>');