mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-22 11:12:36 +01:00
Refactor - fix minor issues from codacy
This commit is contained in:
parent
35a268e66c
commit
5bcfd6191c
@ -134,7 +134,7 @@ namespace Nikse.SubtitleEdit.Core.AudioToText.PocketSphinx
|
||||
{
|
||||
string text = paragraph.Text;
|
||||
string textNoTags = HtmlUtil.RemoveHtmlTags(text, true);
|
||||
if (textNoTags != textNoTags.ToUpper())
|
||||
if (textNoTags != textNoTags.ToUpperInvariant())
|
||||
{
|
||||
if (!string.IsNullOrEmpty(text))
|
||||
{
|
||||
|
@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Core.ContainerFormats.Mp4.Boxes
|
||||
@ -21,11 +20,7 @@ namespace Nikse.SubtitleEdit.Core.ContainerFormats.Mp4.Boxes
|
||||
return;
|
||||
}
|
||||
|
||||
if (Name == "vtte")
|
||||
{
|
||||
Console.WriteLine("vtte");
|
||||
}
|
||||
else if (Name == "vttc")
|
||||
if (Name == "vttc")
|
||||
{
|
||||
var vttc = new Vttc(fs, Position);
|
||||
if (vttc.Payload != null)
|
||||
@ -33,11 +28,6 @@ namespace Nikse.SubtitleEdit.Core.ContainerFormats.Mp4.Boxes
|
||||
Payloads.AddRange(vttc.Payload);
|
||||
}
|
||||
}
|
||||
else if (Name == "payl")
|
||||
{
|
||||
Console.WriteLine("payl");
|
||||
}
|
||||
|
||||
fs.Seek((long)Position, SeekOrigin.Begin);
|
||||
}
|
||||
}
|
||||
|
@ -181,7 +181,7 @@ namespace Nikse.SubtitleEdit.Core.ContainerFormats.Mp4.Boxes
|
||||
var sb = new StringBuilder();
|
||||
for (int j = 8; j < data.Length - 3; j++)
|
||||
{
|
||||
string h = data[j].ToString("X2").ToLower();
|
||||
string h = data[j].ToString("X2").ToLowerInvariant();
|
||||
if (h.Length < 2)
|
||||
{
|
||||
h = "0" + h;
|
||||
|
@ -560,7 +560,7 @@ namespace Nikse.SubtitleEdit.Core.Dictionaries
|
||||
public static string FixLowerCaseLInsideUpperCaseWord(string input)
|
||||
{
|
||||
var word = input;
|
||||
if (word.Length > 3 && word.RemoveChar('l').ToUpper() == word.RemoveChar('l'))
|
||||
if (word.Length > 3 && word.RemoveChar('l').ToUpperInvariant() == word.RemoveChar('l'))
|
||||
{
|
||||
if (!word.Contains('<') && !word.Contains('>') && !word.Contains('\''))
|
||||
{
|
||||
|
@ -160,7 +160,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
var words = text.Substring(idx).Split(' ', '\r', '\n', ',', '"', '?', '!', '.', '\'');
|
||||
if (words.Length > 0 && !notChangeWords.Contains(words[0]))
|
||||
{
|
||||
var upper = text[idx].ToString().ToUpper();
|
||||
var upper = text[idx].ToString().ToUpperInvariant();
|
||||
text = text.Remove(idx, 1).Insert(idx, upper);
|
||||
}
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
!ExpectedString1.Contains(tempNoHtml[tempNoHtml.Length - 1]))
|
||||
{
|
||||
string tempTrimmed = tempNoHtml.TrimEnd().TrimEnd('\'', '"', '“', '”').TrimEnd();
|
||||
if (tempTrimmed.Length > 0 && !ExpectedString2.Contains(tempTrimmed[tempTrimmed.Length - 1]) && p.Text != p.Text.ToUpper())
|
||||
if (tempTrimmed.Length > 0 && !ExpectedString2.Contains(tempTrimmed[tempTrimmed.Length - 1]) && p.Text != p.Text.ToUpperInvariant())
|
||||
{
|
||||
//don't end the sentence if the next word is an I word as they're always capped.
|
||||
bool isNextCloseAndStartsWithI = isNextClose && (nextText.StartsWith("I ", StringComparison.Ordinal) ||
|
||||
@ -117,10 +117,10 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
}
|
||||
else if (next != null && !string.IsNullOrEmpty(p.Text) && Utilities.AllLettersAndNumbers.Contains(p.Text[p.Text.Length - 1]))
|
||||
{
|
||||
if (p.Text != p.Text.ToUpper())
|
||||
if (p.Text != p.Text.ToUpperInvariant())
|
||||
{
|
||||
var st = new StrippableText(next.Text);
|
||||
if (st.StrippedText.Length > 0 && st.StrippedText != st.StrippedText.ToUpper() &&
|
||||
if (st.StrippedText.Length > 0 && st.StrippedText != st.StrippedText.ToUpperInvariant() &&
|
||||
char.IsUpper(st.StrippedText[0]))
|
||||
{
|
||||
if (callbacks.AllowFix(p, fixAction))
|
||||
|
@ -73,7 +73,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
if (fix)
|
||||
{
|
||||
newText = newText.Replace(ms, Configuration.Settings.Tools.MusicSymbol);
|
||||
newText = newText.Replace(ms.ToUpper(), Configuration.Settings.Tools.MusicSymbol);
|
||||
newText = newText.Replace(ms.ToUpperInvariant(), Configuration.Settings.Tools.MusicSymbol);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
wasLastLineClosed = false;
|
||||
}
|
||||
|
||||
if (!wasLastLineClosed && last.Text == last.Text.ToUpper())
|
||||
if (!wasLastLineClosed && last.Text == last.Text.ToUpperInvariant())
|
||||
{
|
||||
wasLastLineClosed = true;
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ namespace Nikse.SubtitleEdit.Core.Forms.FixCommonErrors
|
||||
!s.Contains(Environment.NewLine + "-") &&
|
||||
!(s.StartsWith('[') && s.Contains("]" + Environment.NewLine, StringComparison.Ordinal)) &&
|
||||
!(s.StartsWith('(') && s.Contains(")" + Environment.NewLine, StringComparison.Ordinal)) &&
|
||||
s != s.ToUpper())
|
||||
s != s.ToUpperInvariant())
|
||||
{
|
||||
return Utilities.UnbreakLine(text);
|
||||
}
|
||||
|
@ -243,7 +243,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
}
|
||||
}
|
||||
|
||||
if (temp.Length > 0 && s[0].ToString(CultureInfo.InvariantCulture) != s[0].ToString(CultureInfo.InvariantCulture).ToLower())
|
||||
if (temp.Length > 0 && s[0].ToString(CultureInfo.InvariantCulture) != s[0].ToString(CultureInfo.InvariantCulture).ToLowerInvariant())
|
||||
{
|
||||
temp = char.ToUpper(temp[0]) + temp.Substring(1);
|
||||
doRepeat = true;
|
||||
|
@ -98,7 +98,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
// House 7x01 line 52: and she would like you to do three things:
|
||||
// Okay or remove???
|
||||
string noTagText = HtmlUtil.RemoveHtmlTags(text);
|
||||
if (noTagText.Length > 10 && noTagText.IndexOf(':') == noTagText.Length - 1 && noTagText != noTagText.ToUpper())
|
||||
if (noTagText.Length > 10 && noTagText.IndexOf(':') == noTagText.Length - 1 && noTagText != noTagText.ToUpperInvariant())
|
||||
{
|
||||
return preAssTag + text;
|
||||
}
|
||||
@ -130,7 +130,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
{
|
||||
var pre = line.Substring(0, indexOfColon);
|
||||
var noTagPre = HtmlUtil.RemoveHtmlTags(pre, true);
|
||||
if (Settings.RemoveTextBeforeColonOnlyUppercase && noTagPre != noTagPre.ToUpper())
|
||||
if (Settings.RemoveTextBeforeColonOnlyUppercase && noTagPre != noTagPre.ToUpperInvariant())
|
||||
{
|
||||
bool remove = true;
|
||||
newText = RemovePartialBeforeColon(line, indexOfColon, newText, count, ref removedInFirstLine, ref removedInSecondLine, ref remove);
|
||||
@ -146,7 +146,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
if (indexOf > 0 && indexOf < indexOfColon)
|
||||
{
|
||||
var toRemove = s.Substring(indexOf + 1, indexOfColon - indexOf).Trim();
|
||||
if (toRemove.Length > 1 && toRemove == toRemove.ToUpper())
|
||||
if (toRemove.Length > 1 && toRemove == toRemove.ToUpperInvariant())
|
||||
{
|
||||
s = s.Remove(indexOf + 1, indexOfColon - indexOf);
|
||||
s = s.Insert(indexOf + 1, " -");
|
||||
@ -171,7 +171,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
{
|
||||
if (count == 1 && newText.Length > 1 && removedInFirstLine &&
|
||||
!".?!".Contains(newTextNoHtml[newTextNoHtml.Length - 1]) && newText.LineEndsWithHtmlTag(true) &&
|
||||
line != line.ToUpper())
|
||||
line != line.ToUpperInvariant())
|
||||
{
|
||||
newText += Environment.NewLine;
|
||||
if (pre.Contains("<i>") && line.Contains("</i>") && !line.Contains("<i>"))
|
||||
@ -201,7 +201,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
}
|
||||
else if (count == 1 && newTextNoHtml.Length > 1 && indexOfColon > 15 && line.Substring(0, indexOfColon).Contains(' ') &&
|
||||
!".?!".Contains(newTextNoHtml[newTextNoHtml.Length - 1]) && newText.LineEndsWithHtmlTag(true) &&
|
||||
line != line.ToUpper())
|
||||
line != line.ToUpperInvariant())
|
||||
{
|
||||
newText += Environment.NewLine;
|
||||
if (pre.Contains("<i>") && line.Contains("</i>") && !line.Contains("<i>"))
|
||||
@ -419,7 +419,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
int colonIndex = s2.IndexOf(':');
|
||||
string start = s2.Substring(0, colonIndex);
|
||||
|
||||
if (!Settings.RemoveTextBeforeColonOnlyUppercase || start == start.ToUpper())
|
||||
if (!Settings.RemoveTextBeforeColonOnlyUppercase || start == start.ToUpperInvariant())
|
||||
{
|
||||
int endIndex = start.LastIndexOfAny(endChars);
|
||||
if (colonIndex > 0 && colonIndex < s2.Length - 1)
|
||||
@ -1032,7 +1032,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
|
||||
private bool IsHIDescription(string text)
|
||||
{
|
||||
text = text.Trim(' ', '(', ')', '[', ']', '?', '{', '}').ToLower();
|
||||
text = text.Trim(' ', '(', ')', '[', ']', '?', '{', '}').ToLowerInvariant();
|
||||
if (text.Trim().Replace("mr. ", string.Empty).Replace("mrs. ", string.Empty).Replace("dr. ", string.Empty).Contains(' '))
|
||||
{
|
||||
AddWarning();
|
||||
@ -1047,8 +1047,8 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
|
||||
private static string GetRemovedString(string oldText, string newText)
|
||||
{
|
||||
oldText = oldText.ToLower();
|
||||
newText = newText.ToLower();
|
||||
oldText = oldText.ToLowerInvariant();
|
||||
newText = newText.ToLowerInvariant();
|
||||
|
||||
int start = oldText.IndexOf(newText, StringComparison.Ordinal);
|
||||
string result;
|
||||
@ -1280,7 +1280,7 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
foreach (var line in text.SplitToLines())
|
||||
{
|
||||
var lineNoHtml = HtmlUtil.RemoveHtmlTags(line, true);
|
||||
if (lineNoHtml == lineNoHtml.ToUpper() && lineNoHtml != lineNoHtml.ToLower())
|
||||
if (lineNoHtml == lineNoHtml.ToUpperInvariant() && lineNoHtml != lineNoHtml.ToLowerInvariant())
|
||||
{
|
||||
var temp = lineNoHtml.TrimEnd(endTrimChars).Trim().Trim(trimChars);
|
||||
if (temp.Length == 1 || temp == "YES" || temp == "NO" || temp == "WHY" || temp == "HI" || temp == "OK")
|
||||
@ -1307,8 +1307,8 @@ namespace Nikse.SubtitleEdit.Core.Forms
|
||||
}
|
||||
|
||||
interjectionList.Add(s);
|
||||
interjectionList.Add(s.ToUpper());
|
||||
interjectionList.Add(s.ToLower());
|
||||
interjectionList.Add(s.ToUpperInvariant());
|
||||
interjectionList.Add(s.ToLowerInvariant());
|
||||
interjectionList.Add(s.CapitalizeFirstLetter());
|
||||
}
|
||||
|
||||
|
@ -481,7 +481,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
return false;
|
||||
}
|
||||
|
||||
var allLower = text.ToLower();
|
||||
var allLower = text.ToLowerInvariant();
|
||||
if (allLower.StartsWith("http://", StringComparison.Ordinal) || allLower.StartsWith("https://", StringComparison.Ordinal) ||
|
||||
allLower.StartsWith("www.", StringComparison.Ordinal) || allLower.EndsWith(".org", StringComparison.Ordinal) ||
|
||||
allLower.EndsWith(".com", StringComparison.Ordinal) || allLower.EndsWith(".net", StringComparison.Ordinal))
|
||||
@ -853,8 +853,8 @@ namespace Nikse.SubtitleEdit.Core
|
||||
{
|
||||
text = text.Replace("<" + tag + ">", string.Empty);
|
||||
text = text.Replace("</" + tag + ">", string.Empty);
|
||||
text = text.Replace("<" + tag.ToUpper() + ">", string.Empty);
|
||||
text = text.Replace("</" + tag.ToUpper() + ">", string.Empty);
|
||||
text = text.Replace("<" + tag.ToUpperInvariant() + ">", string.Empty);
|
||||
text = text.Replace("</" + tag.ToUpperInvariant() + ">", string.Empty);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -560,7 +560,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
}
|
||||
|
||||
int count;
|
||||
switch (shortName.Replace("-", "_").ToLower())
|
||||
switch (shortName.Replace("-", "_").ToLowerInvariant())
|
||||
{
|
||||
case "da_dk":
|
||||
count = GetCount(text, AutoDetectWordsDanish);
|
||||
@ -1076,7 +1076,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
{ // keep utf-8 encoding if it's default
|
||||
encoding = Encoding.UTF8;
|
||||
}
|
||||
else if (couldBeUtf8 && fileName.EndsWith(".xml", StringComparison.OrdinalIgnoreCase) && Encoding.Default.GetString(buffer).ToLower().Replace('\'', '"').Contains("encoding=\"utf-8\""))
|
||||
else if (couldBeUtf8 && fileName.EndsWith(".xml", StringComparison.OrdinalIgnoreCase) && Encoding.Default.GetString(buffer).ToLowerInvariant().Replace('\'', '"').Contains("encoding=\"utf-8\""))
|
||||
{ // keep utf-8 encoding for xml files with utf-8 in header (without any utf-8 encoded characters, but with only allowed utf-8 characters)
|
||||
encoding = Encoding.UTF8;
|
||||
}
|
||||
|
@ -494,7 +494,7 @@ $HorzAlign = Center
|
||||
}
|
||||
else
|
||||
{
|
||||
string hex = Guid.NewGuid().ToString().RemoveChar('-').ToLower();
|
||||
string hex = Guid.NewGuid().ToString().RemoveChar('-').ToLowerInvariant();
|
||||
hex = hex.Insert(8, "-").Insert(13, "-").Insert(18, "-").Insert(23, "-");
|
||||
CurrentDCinemaSubtitleId = hex;
|
||||
CurrentDCinemaLanguage = "English";
|
||||
|
@ -46,7 +46,7 @@ namespace Nikse.SubtitleEdit.Core.SpellCheck
|
||||
|
||||
foreach (string namesItem in _names)
|
||||
{
|
||||
_namesListUppercase.Add(namesItem.ToUpper());
|
||||
_namesListUppercase.Add(namesItem.ToUpperInvariant());
|
||||
}
|
||||
|
||||
if (languageName.StartsWith("en_", StringComparison.OrdinalIgnoreCase))
|
||||
@ -76,7 +76,7 @@ namespace Nikse.SubtitleEdit.Core.SpellCheck
|
||||
{
|
||||
foreach (XmlNode node in xmlNodeList)
|
||||
{
|
||||
string word = node.InnerText.Trim().ToLower();
|
||||
string word = node.InnerText.Trim().ToLowerInvariant();
|
||||
if (word.Contains(' '))
|
||||
{
|
||||
_userPhraseList.Add(word);
|
||||
@ -224,11 +224,11 @@ namespace Nikse.SubtitleEdit.Core.SpellCheck
|
||||
}
|
||||
|
||||
_names.Remove(word);
|
||||
_namesListUppercase.Remove(word.ToUpper());
|
||||
_namesListUppercase.Remove(word.ToUpperInvariant());
|
||||
if (_languageName.StartsWith("en_", StringComparison.Ordinal) && !word.EndsWith('s'))
|
||||
{
|
||||
_names.Remove(word + "s");
|
||||
_namesListUppercase.Remove(word.ToUpper() + "S");
|
||||
_namesListUppercase.Remove(word.ToUpperInvariant() + "S");
|
||||
}
|
||||
if (!word.EndsWith('s'))
|
||||
{
|
||||
@ -426,16 +426,16 @@ namespace Nikse.SubtitleEdit.Core.SpellCheck
|
||||
}
|
||||
|
||||
_names.Add(word);
|
||||
_namesListUppercase.Add(word.ToUpper());
|
||||
_namesListUppercase.Add(word.ToUpperInvariant());
|
||||
if (_languageName.StartsWith("en_", StringComparison.Ordinal) && !word.EndsWith('s'))
|
||||
{
|
||||
_names.Add(word + "s");
|
||||
_namesListUppercase.Add(word.ToUpper() + "S");
|
||||
_namesListUppercase.Add(word.ToUpperInvariant() + "S");
|
||||
}
|
||||
if (!word.EndsWith('s'))
|
||||
{
|
||||
_namesListWithApostrophe.Add(word + "'s");
|
||||
_namesListUppercase.Add(word.ToUpper() + "'S");
|
||||
_namesListUppercase.Add(word.ToUpperInvariant() + "'S");
|
||||
}
|
||||
if (!word.EndsWith('\''))
|
||||
{
|
||||
@ -456,7 +456,7 @@ namespace Nikse.SubtitleEdit.Core.SpellCheck
|
||||
return false;
|
||||
}
|
||||
|
||||
word = word.Trim().ToLower();
|
||||
word = word.Trim().ToLowerInvariant();
|
||||
if (word.Length == 0 || _userWordList.Contains(word))
|
||||
{
|
||||
return false;
|
||||
@ -487,7 +487,7 @@ namespace Nikse.SubtitleEdit.Core.SpellCheck
|
||||
|
||||
public bool HasUserWord(string word)
|
||||
{
|
||||
string s = word.ToLower();
|
||||
string s = word.ToLowerInvariant();
|
||||
return _userWordList.Contains(s) || (s.StartsWith('\'') || s.EndsWith('\'')) && _userWordList.Contains(s.Trim('\''));
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
Post = Post.Remove(0, 1);
|
||||
}
|
||||
|
||||
string lower = StrippedText.ToLower();
|
||||
string lower = StrippedText.ToLowerInvariant();
|
||||
int idName = 0;
|
||||
foreach (string name in nameList)
|
||||
{
|
||||
@ -147,7 +147,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
originalNames.Add(originalName);
|
||||
StrippedText = StrippedText.Remove(start, name.Length);
|
||||
StrippedText = StrippedText.Insert(start, GetAndInsertNextId(replaceIds, replaceNames, name, idName++));
|
||||
lower = StrippedText.ToLower();
|
||||
lower = StrippedText.ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
if (start + 3 > lower.Length)
|
||||
|
@ -873,7 +873,7 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
|
||||
|
||||
// switch to rrggbb from bbggrr
|
||||
color = "#" + color.Remove(color.Length - 6) + color.Substring(color.Length - 2, 2) + color.Substring(color.Length - 4, 2) + color.Substring(color.Length - 6, 2);
|
||||
color = color.ToLower();
|
||||
color = color.ToLowerInvariant();
|
||||
|
||||
text = text.Remove(start, end - start + 1);
|
||||
if (italic)
|
||||
@ -918,7 +918,7 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
|
||||
|
||||
// switch to rrggbb from bbggrr
|
||||
color = "#" + color.Remove(color.Length - 6) + color.Substring(color.Length - 2, 2) + color.Substring(color.Length - 4, 2) + color.Substring(color.Length - 6, 2);
|
||||
color = color.ToLower();
|
||||
color = color.ToLowerInvariant();
|
||||
|
||||
text = text.Remove(start, end - start + 1);
|
||||
if (italic)
|
||||
@ -1074,7 +1074,7 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
|
||||
color = color.PadLeft(6, '0');
|
||||
// switch to rrggbb from bbggrr
|
||||
color = "#" + color.Remove(color.Length - 6) + color.Substring(color.Length - 2, 2) + color.Substring(color.Length - 4, 2) + color.Substring(color.Length - 6, 2);
|
||||
color = color.ToLower();
|
||||
color = color.ToLowerInvariant();
|
||||
|
||||
extraTags += " color=\"" + color + "\"";
|
||||
}
|
||||
@ -1198,7 +1198,7 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
|
||||
}
|
||||
else if (eventsStarted)
|
||||
{
|
||||
string s = line.Trim().ToLower();
|
||||
string s = line.Trim().ToLowerInvariant();
|
||||
if (line.Length > 10 && s.StartsWith("format:", StringComparison.Ordinal))
|
||||
{
|
||||
indexLayer = -1;
|
||||
@ -1624,12 +1624,12 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
|
||||
|
||||
foreach (string line in header.SplitToLines())
|
||||
{
|
||||
string s = line.Trim().ToLower();
|
||||
string s = line.Trim().ToLowerInvariant();
|
||||
if (s.StartsWith("format:", StringComparison.Ordinal))
|
||||
{
|
||||
if (line.Length > 10)
|
||||
{
|
||||
var format = line.Substring(8).ToLower().Split(',');
|
||||
var format = line.Substring(8).ToLowerInvariant().Split(',');
|
||||
styleCount = format.Length;
|
||||
for (int i = 0; i < format.Length; i++)
|
||||
{
|
||||
@ -1722,7 +1722,7 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
|
||||
Color dummyColor = Color.FromArgb(9, 14, 16, 26);
|
||||
for (int i = 0; i < format.Length; i++)
|
||||
{
|
||||
string f = format[i].Trim().ToLower();
|
||||
string f = format[i].Trim().ToLowerInvariant();
|
||||
if (i == nameIndex)
|
||||
{
|
||||
if (f.Length == 0)
|
||||
@ -1938,15 +1938,15 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
|
||||
|
||||
foreach (string line in header.SplitToLines())
|
||||
{
|
||||
string s = line.Trim().ToLower();
|
||||
string s = line.Trim().ToLowerInvariant();
|
||||
if (s.StartsWith("format:", StringComparison.Ordinal))
|
||||
{
|
||||
if (line.Length > 10)
|
||||
{
|
||||
var format = line.ToLower().Substring(8).Split(',');
|
||||
var format = line.ToLowerInvariant().Substring(8).Split(',');
|
||||
for (int i = 0; i < format.Length; i++)
|
||||
{
|
||||
string f = format[i].Trim().ToLower();
|
||||
string f = format[i].Trim().ToLowerInvariant();
|
||||
if (f == "name")
|
||||
{
|
||||
nameIndex = i;
|
||||
@ -2030,7 +2030,7 @@ Format: Layer, Start, End, Style, Actor, MarginL, MarginR, MarginV, Effect, Text
|
||||
var format = line.Substring(6).Split(',');
|
||||
for (int i = 0; i < format.Length; i++)
|
||||
{
|
||||
string f = format[i].Trim().ToLower();
|
||||
string f = format[i].Trim().ToLowerInvariant();
|
||||
if (i == nameIndex)
|
||||
{
|
||||
style.Name = format[i].Trim();
|
||||
|
@ -100,7 +100,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
hex = hex.Insert(8, "-").Insert(13, "-").Insert(18, "-").Insert(23, "-");
|
||||
|
||||
string xmlStructure = "<DCSubtitle Version=\"1.0\">" + Environment.NewLine +
|
||||
" <SubtitleID>" + hex.ToLower() + "</SubtitleID>" + Environment.NewLine +
|
||||
" <SubtitleID>" + hex.ToLowerInvariant() + "</SubtitleID>" + Environment.NewLine +
|
||||
" <MovieTitle></MovieTitle>" + Environment.NewLine +
|
||||
" <ReelNumber>1</ReelNumber>" + Environment.NewLine +
|
||||
" <Language>" + languageEnglishName + "</Language>" + Environment.NewLine +
|
||||
@ -138,9 +138,9 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
xml.DocumentElement.SelectSingleNode("LoadFont").Attributes["Id"].InnerText = loadedFontId;
|
||||
int fontSize = ss.CurrentDCinemaFontSize;
|
||||
xml.DocumentElement.SelectSingleNode("Font").Attributes["Id"].InnerText = loadedFontId;
|
||||
xml.DocumentElement.SelectSingleNode("Font").Attributes["Color"].InnerText = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontColor).TrimStart('#').ToUpper();
|
||||
xml.DocumentElement.SelectSingleNode("Font").Attributes["Color"].InnerText = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontColor).TrimStart('#').ToUpperInvariant();
|
||||
xml.DocumentElement.SelectSingleNode("Font").Attributes["Effect"].InnerText = ss.CurrentDCinemaFontEffect;
|
||||
xml.DocumentElement.SelectSingleNode("Font").Attributes["EffectColor"].InnerText = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontEffectColor).TrimStart('#').ToUpper();
|
||||
xml.DocumentElement.SelectSingleNode("Font").Attributes["EffectColor"].InnerText = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontEffectColor).TrimStart('#').ToUpperInvariant();
|
||||
xml.DocumentElement.SelectSingleNode("Font").Attributes["Size"].InnerText = ss.CurrentDCinemaFontSize.ToString();
|
||||
|
||||
var mainListFont = xml.DocumentElement.SelectSingleNode("Font");
|
||||
@ -318,7 +318,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
c = c.Trim('"').Trim('\'').Trim();
|
||||
if (c.StartsWith('#'))
|
||||
{
|
||||
c = c.TrimStart('#').ToUpper().PadLeft(8, 'F');
|
||||
c = c.TrimStart('#').ToUpperInvariant().PadLeft(8, 'F');
|
||||
}
|
||||
|
||||
fontColors.Push(c);
|
||||
|
@ -165,10 +165,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
|
||||
xml.DocumentElement.SelectSingleNode("dcst:LoadFont", nsmgr).Attributes["ID"].Value = loadedFontId;
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["Size"].Value = fontSize.ToString();
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["Color"].Value = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontColor).TrimStart('#').ToUpper();
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["Color"].Value = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontColor).TrimStart('#').ToUpperInvariant();
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["ID"].Value = loadedFontId;
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["Effect"].Value = ss.CurrentDCinemaFontEffect;
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["EffectColor"].Value = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontEffectColor).TrimStart('#').ToUpper();
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["EffectColor"].Value = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontEffectColor).TrimStart('#').ToUpperInvariant();
|
||||
|
||||
XmlNode mainListFont = xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr);
|
||||
int no = 0;
|
||||
@ -331,7 +331,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
c = c.Trim('"').Trim('\'').Trim();
|
||||
if (c.StartsWith('#'))
|
||||
{
|
||||
c = c.TrimStart('#').ToUpper().PadLeft(8, 'F');
|
||||
c = c.TrimStart('#').ToUpperInvariant().PadLeft(8, 'F');
|
||||
}
|
||||
|
||||
fontColors.Push(c);
|
||||
@ -795,7 +795,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
|
||||
private static string GetColorStringFromDCinema(string p)
|
||||
{
|
||||
string s = p.ToLower().Trim();
|
||||
string s = p.ToLowerInvariant().Trim();
|
||||
if (s.Replace("#", string.Empty).
|
||||
Replace("0", string.Empty).
|
||||
Replace("1", string.Empty).
|
||||
|
@ -166,10 +166,10 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
|
||||
xml.DocumentElement.SelectSingleNode("dcst:LoadFont", nsmgr).Attributes["ID"].Value = loadedFontId;
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["Size"].Value = fontSize.ToString();
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["Color"].Value = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontColor).TrimStart('#').ToUpper();
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["Color"].Value = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontColor).TrimStart('#').ToUpperInvariant();
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["ID"].Value = loadedFontId;
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["Effect"].Value = ss.CurrentDCinemaFontEffect;
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["EffectColor"].Value = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontEffectColor).TrimStart('#').ToUpper();
|
||||
xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr).Attributes["EffectColor"].Value = "FF" + Utilities.ColorToHex(ss.CurrentDCinemaFontEffectColor).TrimStart('#').ToUpperInvariant();
|
||||
|
||||
XmlNode mainListFont = xml.DocumentElement.SelectSingleNode("dcst:SubtitleList/dcst:Font", nsmgr);
|
||||
int no = 0;
|
||||
@ -332,7 +332,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
c = c.Trim('"').Trim('\'').Trim();
|
||||
if (c.StartsWith('#'))
|
||||
{
|
||||
c = c.TrimStart('#').ToUpper().PadLeft(8, 'F');
|
||||
c = c.TrimStart('#').ToUpperInvariant().PadLeft(8, 'F');
|
||||
}
|
||||
|
||||
fontColors.Push(c);
|
||||
|
@ -578,7 +578,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
|
||||
private static string GetNearestEbuColorCode(string color, Encoding encoding)
|
||||
{
|
||||
color = color.ToLower();
|
||||
color = color.ToLowerInvariant();
|
||||
if (color == "black" || color == "000000")
|
||||
{
|
||||
return encoding.GetString(new byte[] { 0x00 }); // black
|
||||
|
@ -91,7 +91,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
xml.LoadXml(xmlStructure);
|
||||
xml.DocumentElement.SelectSingleNode("sequence").Attributes["id"].Value = title;
|
||||
xml.DocumentElement.SelectSingleNode("sequence/name").InnerText = title;
|
||||
xml.DocumentElement.SelectSingleNode("sequence/uuid").InnerText = Guid.NewGuid().ToString().ToUpper();
|
||||
xml.DocumentElement.SelectSingleNode("sequence/uuid").InnerText = Guid.NewGuid().ToString().ToUpperInvariant();
|
||||
if (!string.IsNullOrEmpty(subtitle.Header))
|
||||
{
|
||||
var header = new XmlDocument();
|
||||
@ -237,7 +237,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var styleNameNode = valueEntries[no].SelectSingleNode("name");
|
||||
if (styleNameNode != null)
|
||||
{
|
||||
string styleName = styleNameNode.InnerText.ToLower().Trim();
|
||||
string styleName = styleNameNode.InnerText.ToLowerInvariant().Trim();
|
||||
italic = styleName == "italic" || styleName == "bold/italic";
|
||||
bold = styleName == "bold" || styleName == "bold/italic";
|
||||
}
|
||||
@ -262,7 +262,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var styleNameNode = valueEntries[no].SelectSingleNode("name");
|
||||
if (styleNameNode != null)
|
||||
{
|
||||
string styleName = styleNameNode.InnerText.ToLower().Trim();
|
||||
string styleName = styleNameNode.InnerText.ToLowerInvariant().Trim();
|
||||
italic = styleName == "italic" || styleName == "bold/italic";
|
||||
bold = styleName == "bold" || styleName == "bold/italic";
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
xml.DocumentElement.SelectSingleNode("sequence").Attributes["id"].Value = title;
|
||||
xml.DocumentElement.SelectSingleNode("sequence/name").InnerText = title;
|
||||
|
||||
xml.DocumentElement.SelectSingleNode("sequence/uuid").InnerText = Guid.NewGuid().ToString().ToUpper();
|
||||
xml.DocumentElement.SelectSingleNode("sequence/uuid").InnerText = Guid.NewGuid().ToString().ToUpperInvariant();
|
||||
if (!string.IsNullOrEmpty(subtitle.Header))
|
||||
{
|
||||
var header = new XmlDocument();
|
||||
@ -322,7 +322,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var styleNameNode = valueEntries[no].SelectSingleNode("name");
|
||||
if (styleNameNode != null)
|
||||
{
|
||||
string styleName = styleNameNode.InnerText.ToLower().Trim();
|
||||
string styleName = styleNameNode.InnerText.ToLowerInvariant().Trim();
|
||||
italic = styleName == "italic" || styleName == "bold/italic";
|
||||
bold = styleName == "bold" || styleName == "bold/italic";
|
||||
}
|
||||
@ -347,7 +347,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var styleNameNode = valueEntries[no].SelectSingleNode("name");
|
||||
if (styleNameNode != null)
|
||||
{
|
||||
string styleName = styleNameNode.InnerText.ToLower().Trim();
|
||||
string styleName = styleNameNode.InnerText.ToLowerInvariant().Trim();
|
||||
italic = styleName == "italic" || styleName == "bold/italic";
|
||||
bold = styleName == "bold" || styleName == "bold/italic";
|
||||
}
|
||||
|
@ -386,7 +386,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
xml.LoadXml(xmlStructure);
|
||||
xml.DocumentElement.SelectSingleNode("sequence").Attributes["id"].Value = title;
|
||||
xml.DocumentElement.SelectSingleNode("sequence/name").InnerText = title;
|
||||
xml.DocumentElement.SelectSingleNode("sequence/uuid").InnerText = Guid.NewGuid().ToString().ToUpper();
|
||||
xml.DocumentElement.SelectSingleNode("sequence/uuid").InnerText = Guid.NewGuid().ToString().ToUpperInvariant();
|
||||
if (!string.IsNullOrEmpty(subtitle.Header))
|
||||
{
|
||||
var header = new XmlDocument();
|
||||
@ -581,7 +581,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var styleNameNode = valueEntries[no].SelectSingleNode("name");
|
||||
if (styleNameNode != null)
|
||||
{
|
||||
string styleName = styleNameNode.InnerText.ToLower().Trim();
|
||||
string styleName = styleNameNode.InnerText.ToLowerInvariant().Trim();
|
||||
italic = styleName == "italic" || styleName == "bold/italic";
|
||||
bold = styleName == "bold" || styleName == "bold/italic";
|
||||
}
|
||||
@ -606,7 +606,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var styleNameNode = valueEntries[no].SelectSingleNode("name");
|
||||
if (styleNameNode != null)
|
||||
{
|
||||
string styleName = styleNameNode.InnerText.ToLower().Trim();
|
||||
string styleName = styleNameNode.InnerText.ToLowerInvariant().Trim();
|
||||
italic = styleName == "italic" || styleName == "bold/italic";
|
||||
bold = styleName == "bold" || styleName == "bold/italic";
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
actor = actor.Replace("( CONT’D )", string.Empty).Trim();
|
||||
actor = actor.Replace("(CONT'D)", string.Empty).Trim();
|
||||
actor = actor.Replace("(CONT’D)", string.Empty).Trim();
|
||||
actor = actor.ToUpper();
|
||||
actor = actor.ToUpperInvariant();
|
||||
}
|
||||
else if (paragraphType != null && lowercaseChosencategories.Contains(paragraphType.InnerText.ToLowerInvariant()))
|
||||
{
|
||||
|
@ -53,7 +53,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////////");
|
||||
sb.AppendLine();
|
||||
sb.AppendLine("UUID=" + Guid.NewGuid().ToString().ToUpper());// UUID=9F6112F4-D9D0-4AAF-AA95-854710D3B57A
|
||||
sb.AppendLine("UUID=" + Guid.NewGuid().ToString().ToUpperInvariant());// UUID=9F6112F4-D9D0-4AAF-AA95-854710D3B57A
|
||||
sb.AppendLine("Creation Program=Subtitle Edit");
|
||||
sb.AppendLine("Creation Date=" + DateTime.Now.ToLongDateString());
|
||||
sb.AppendLine("Creation Time=" + DateTime.Now.ToShortTimeString());
|
||||
|
@ -34,7 +34,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
var language = LanguageAutoDetect.AutoDetectGoogleLanguage(subtitle);
|
||||
var ci = CultureInfo.GetCultureInfo(language);
|
||||
language = CultureInfo.CreateSpecificCulture(ci.Name).Name;
|
||||
string languageTag = $"{language.Replace("-", string.Empty).ToUpper()}CC";
|
||||
string languageTag = $"{language.Replace("-", string.Empty).ToUpperInvariant()}CC";
|
||||
string languageName = ci.EnglishName;
|
||||
string languageStyle = $".{languageTag} [ name: {languageName}; lang: {language.Replace("_", "-")} ; SAMIType: CC ; ]";
|
||||
languageStyle = languageStyle.Replace("[", "{").Replace("]", "}");
|
||||
@ -225,7 +225,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
string language = LanguageAutoDetect.AutoDetectGoogleLanguage(subtitle);
|
||||
var ci = CultureInfo.GetCultureInfo(language);
|
||||
language = CultureInfo.CreateSpecificCulture(ci.Name).Name;
|
||||
string languageTag = $"{language.Replace("-", string.Empty).ToUpper()}CC";
|
||||
string languageTag = $"{language.Replace("-", string.Empty).ToUpperInvariant()}CC";
|
||||
return new List<string> { languageTag };
|
||||
}
|
||||
|
||||
@ -239,7 +239,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
}
|
||||
|
||||
string allInput = sb.ToString();
|
||||
string allInputLower = allInput.ToLower();
|
||||
string allInputLower = allInput.ToLowerInvariant();
|
||||
if (!allInputLower.Contains("<sync "))
|
||||
{
|
||||
return;
|
||||
@ -309,7 +309,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
text = allInput.Substring(index);
|
||||
}
|
||||
|
||||
string textToLower = text.ToLower();
|
||||
string textToLower = text.ToLowerInvariant();
|
||||
if (textToLower.Contains(" class="))
|
||||
{
|
||||
var className = new StringBuilder();
|
||||
@ -332,7 +332,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
}
|
||||
|
||||
int st = sourceIndex - 1;
|
||||
while (st > 0 && text.Substring(st, 2).ToUpper() != "<P")
|
||||
while (st > 0 && text.Substring(st, 2).ToUpperInvariant() != "<P")
|
||||
{
|
||||
st--;
|
||||
}
|
||||
@ -341,7 +341,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
text = text.Substring(0, st) + text.Substring(sourceIndex);
|
||||
}
|
||||
int et = st;
|
||||
while (et < text.Length - 5 && text.Substring(et, 3).ToUpper() != "<P>" && text.Substring(et, 4).ToUpper() != "</P>")
|
||||
while (et < text.Length - 5 && text.Substring(et, 3).ToUpperInvariant() != "<P>" && text.Substring(et, 4).ToUpper() != "</P>")
|
||||
{
|
||||
et++;
|
||||
}
|
||||
@ -361,7 +361,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
text = text.Replace("</BODY>", string.Empty).Replace("</SAMI>", string.Empty).TrimEnd();
|
||||
text = text.Replace("</body>", string.Empty).Replace("</sami>", string.Empty).TrimEnd();
|
||||
|
||||
int endSyncPos = text.ToUpper().IndexOf("</SYNC>", StringComparison.OrdinalIgnoreCase);
|
||||
int endSyncPos = text.ToUpperInvariant().IndexOf("</SYNC>", StringComparison.OrdinalIgnoreCase);
|
||||
if (text.IndexOf('>') > 0 && (text.IndexOf('>') < endSyncPos || endSyncPos == -1))
|
||||
{
|
||||
text = text.Remove(0, text.IndexOf('>') + 1);
|
||||
@ -482,8 +482,8 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
subtitle.Renumber();
|
||||
|
||||
if (subtitle.Paragraphs.Count > 0 &&
|
||||
(subtitle.Paragraphs[subtitle.Paragraphs.Count - 1].Text.ToUpper().Trim() == "</BODY>" ||
|
||||
subtitle.Paragraphs[subtitle.Paragraphs.Count - 1].Text.ToUpper().Trim() == "<BODY>"))
|
||||
(subtitle.Paragraphs[subtitle.Paragraphs.Count - 1].Text.ToUpperInvariant().Trim() == "</BODY>" ||
|
||||
subtitle.Paragraphs[subtitle.Paragraphs.Count - 1].Text.ToUpperInvariant().Trim() == "<BODY>"))
|
||||
{
|
||||
subtitle.Paragraphs.RemoveAt(subtitle.Paragraphs.Count - 1);
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
}
|
||||
|
||||
string allInput = sb.ToString();
|
||||
string allInputLower = allInput.ToLower();
|
||||
string allInputLower = allInput.ToLowerInvariant();
|
||||
const string syncTag = "<p ";
|
||||
var syncStartPos = allInputLower.IndexOf(syncTag, StringComparison.Ordinal);
|
||||
int index = syncStartPos + syncTag.Length;
|
||||
|
@ -397,7 +397,7 @@ Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
|
||||
}
|
||||
else if (eventsStarted && !string.IsNullOrWhiteSpace(line))
|
||||
{
|
||||
string s = line.Trim().ToLower();
|
||||
string s = line.Trim().ToLowerInvariant();
|
||||
if (line.Length > 10 && s.StartsWith("format:", StringComparison.Ordinal))
|
||||
{
|
||||
var format = s.Substring(8).Split(',');
|
||||
|
@ -1428,7 +1428,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
{
|
||||
if (p.Language != null)
|
||||
{
|
||||
string l = p.Language.ToLower().Trim();
|
||||
string l = p.Language.ToLowerInvariant().Trim();
|
||||
if (!list.Contains(l))
|
||||
{
|
||||
list.Add(l);
|
||||
|
@ -34,7 +34,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
sb.AppendLine(EncodeTimeCode(p.EndTime));
|
||||
if (!string.IsNullOrEmpty(p.Actor))
|
||||
{
|
||||
sb.AppendLine(p.Actor.ToUpper());
|
||||
sb.AppendLine(p.Actor.ToUpperInvariant());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -94,7 +94,7 @@ namespace Nikse.SubtitleEdit.Core.SubtitleFormats
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(line) && expectActor)
|
||||
{
|
||||
if (line == line.ToUpper())
|
||||
if (line == line.ToUpperInvariant())
|
||||
{
|
||||
p.Actor = line;
|
||||
}
|
||||
|
@ -1183,7 +1183,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
userWordDictionary.Load(userWordListXmlFileName);
|
||||
foreach (XmlNode node in userWordDictionary.DocumentElement.SelectNodes("word"))
|
||||
{
|
||||
string s = node.InnerText.ToLower();
|
||||
string s = node.InnerText.ToLowerInvariant();
|
||||
if (!userWordList.Contains(s))
|
||||
{
|
||||
userWordList.Add(s);
|
||||
@ -1206,7 +1206,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
{
|
||||
foreach (XmlNode node in nodes)
|
||||
{
|
||||
string s = node.InnerText.ToLower();
|
||||
string s = node.InnerText.ToLowerInvariant();
|
||||
if (!userWordList.Contains(s))
|
||||
{
|
||||
userWordList.Add(s);
|
||||
@ -1217,8 +1217,8 @@ namespace Nikse.SubtitleEdit.Core
|
||||
return userWordListXmlFileName;
|
||||
}
|
||||
|
||||
public static readonly string UppercaseLetters = Configuration.Settings.General.UppercaseLetters.ToUpper();
|
||||
public static readonly string LowercaseLetters = Configuration.Settings.General.UppercaseLetters.ToLower();
|
||||
public static readonly string UppercaseLetters = Configuration.Settings.General.UppercaseLetters.ToUpperInvariant();
|
||||
public static readonly string LowercaseLetters = Configuration.Settings.General.UppercaseLetters.ToLowerInvariant();
|
||||
public static readonly string LowercaseLettersWithNumbers = LowercaseLetters + "0123456789";
|
||||
public static readonly string AllLetters = UppercaseLetters + LowercaseLetters;
|
||||
public static readonly string AllLettersAndNumbers = UppercaseLetters + LowercaseLettersWithNumbers;
|
||||
@ -2284,7 +2284,7 @@ namespace Nikse.SubtitleEdit.Core
|
||||
var endIdx = text.IndexOf('>', idx + 6);
|
||||
if (endIdx > idx && endIdx < text.Length - 8)
|
||||
{
|
||||
var color = text.Substring(idx, (endIdx - idx) + 1).ToLower();
|
||||
var color = text.Substring(idx, (endIdx - idx) + 1).ToLowerInvariant();
|
||||
text = RemoveSpaceBeforeAfterTag(text, color);
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ namespace Nikse.SubtitleEdit.Core.VobSub
|
||||
public void WriteParagraph(Paragraph p, Bitmap bmp, ContentAlignment alignment, Point? overridePosition = null) // inspired by code from SubtitleCreator
|
||||
{
|
||||
// timestamp: 00:00:33:900, filepos: 000000000
|
||||
_idx.AppendLine($"timestamp: {p.StartTime.Hours:00}:{p.StartTime.Minutes:00}:{p.StartTime.Seconds:00}:{p.StartTime.Milliseconds:000}, filepos: {_subFile.Position.ToString("X").PadLeft(9, '0').ToLower()}");
|
||||
_idx.AppendLine($"timestamp: {p.StartTime.Hours:00}:{p.StartTime.Minutes:00}:{p.StartTime.Seconds:00}:{p.StartTime.Milliseconds:000}, filepos: {_subFile.Position.ToString("X").PadLeft(9, '0').ToLowerInvariant()}");
|
||||
|
||||
var nbmp = new NikseBitmap(bmp);
|
||||
_emphasis2 = nbmp.ConverToFourColors(_background, _pattern, _emphasis1, _useInnerAntialiasing);
|
||||
@ -429,7 +429,7 @@ id: " + _languageNameShort + @", index: 0
|
||||
|
||||
private static string ToHexColor(Color c)
|
||||
{
|
||||
return (c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2")).ToLower();
|
||||
return (c.R.ToString("X2") + c.G.ToString("X2") + c.B.ToString("X2")).ToLowerInvariant();
|
||||
}
|
||||
|
||||
private void ReleaseManagedResources()
|
||||
|
@ -35,7 +35,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
private void buttonOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
NewWord = textBoxAddName.Text.RemoveControlCharacters().Trim().ToLower();
|
||||
NewWord = textBoxAddName.Text.RemoveControlCharacters().Trim().ToLowerInvariant();
|
||||
if (NewWord.Length == 0)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
|
@ -146,7 +146,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
try
|
||||
{
|
||||
string ext = Path.GetExtension(fileName).ToLower();
|
||||
string ext = Path.GetExtension(fileName).ToLowerInvariant();
|
||||
if (Utilities.VideoFileExtensions.Contains(ext))
|
||||
{
|
||||
var fi = new FileInfo(fileName);
|
||||
@ -268,34 +268,34 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
// check for delay in matroska files
|
||||
var audioTrackNames = new List<string>();
|
||||
var mkvAudioTrackNumbers = new Dictionary<int, int>();
|
||||
if (fileName.ToLower().EndsWith(".mkv", StringComparison.OrdinalIgnoreCase))
|
||||
if (fileName.ToLowerInvariant().EndsWith(".mkv", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MatroskaFile matroska = null;
|
||||
try
|
||||
{
|
||||
matroska = new MatroskaFile(fileName);
|
||||
|
||||
if (matroska.IsValid)
|
||||
using (MatroskaFile matroska = new MatroskaFile(fileName))
|
||||
{
|
||||
foreach (var track in matroska.GetTracks())
|
||||
if (matroska.IsValid)
|
||||
{
|
||||
if (track.IsAudio)
|
||||
foreach (var track in matroska.GetTracks())
|
||||
{
|
||||
if (track.CodecId != null && track.Language != null)
|
||||
if (track.IsAudio)
|
||||
{
|
||||
audioTrackNames.Add("#" + track.TrackNumber + ": " + track.CodecId.Replace("\0", string.Empty) + " - " + track.Language.Replace("\0", string.Empty));
|
||||
}
|
||||
else
|
||||
{
|
||||
audioTrackNames.Add("#" + track.TrackNumber);
|
||||
}
|
||||
if (track.CodecId != null && track.Language != null)
|
||||
{
|
||||
audioTrackNames.Add("#" + track.TrackNumber + ": " + track.CodecId.Replace("\0", string.Empty) + " - " + track.Language.Replace("\0", string.Empty));
|
||||
}
|
||||
else
|
||||
{
|
||||
audioTrackNames.Add("#" + track.TrackNumber);
|
||||
}
|
||||
|
||||
mkvAudioTrackNumbers.Add(mkvAudioTrackNumbers.Count, track.TrackNumber);
|
||||
mkvAudioTrackNumbers.Add(mkvAudioTrackNumbers.Count, track.TrackNumber);
|
||||
}
|
||||
}
|
||||
if (mkvAudioTrackNumbers.Count > 0)
|
||||
{
|
||||
_delayInMilliseconds = (int)matroska.GetTrackStartTime(mkvAudioTrackNumbers[0]);
|
||||
}
|
||||
}
|
||||
if (mkvAudioTrackNumbers.Count > 0)
|
||||
{
|
||||
_delayInMilliseconds = (int)matroska.GetTrackStartTime(mkvAudioTrackNumbers[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -303,10 +303,6 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
_delayInMilliseconds = 0;
|
||||
}
|
||||
finally
|
||||
{
|
||||
matroska?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
updateStatus(Configuration.Settings.Language.AddWaveformBatch.Calculating);
|
||||
|
@ -118,7 +118,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
// check for delay in matroska files
|
||||
var mkvAudioTrackNumbers = new Dictionary<int, int>();
|
||||
if (_videoFileName.ToLower().EndsWith(".mkv", StringComparison.OrdinalIgnoreCase))
|
||||
if (_videoFileName.ToLowerInvariant().EndsWith(".mkv", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
MatroskaFile matroska = null;
|
||||
try
|
||||
|
@ -367,7 +367,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
else if (text.Substring(i).StartsWith("</font>", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (text.Substring(i).ToLower().Replace("</font>", string.Empty).Length > 0)
|
||||
if (text.Substring(i).ToLowerInvariant().Replace("</font>", string.Empty).Length > 0)
|
||||
{
|
||||
if (lastText.EndsWith(' ') && !sb.StartsWith(' '))
|
||||
{
|
||||
|
@ -96,9 +96,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string name = item.SubItems[1].Text;
|
||||
|
||||
string textNoTags = HtmlUtil.RemoveHtmlTags(text, true);
|
||||
if (textNoTags != textNoTags.ToUpper())
|
||||
if (textNoTags != textNoTags.ToUpperInvariant())
|
||||
{
|
||||
if (item.Checked && text != null && text.Contains(name, StringComparison.OrdinalIgnoreCase) && name.Length > 1 && name != name.ToLower())
|
||||
if (item.Checked && text != null && text.Contains(name, StringComparison.OrdinalIgnoreCase) && name.Length > 1 && name != name.ToLowerInvariant())
|
||||
{
|
||||
var st = new StrippableText(text);
|
||||
st.FixCasing(new List<string> { name }, true, false, false, string.Empty);
|
||||
@ -140,15 +140,15 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
private void FindAllNames()
|
||||
{
|
||||
string text = HtmlUtil.RemoveHtmlTags(_subtitle.GetAllTexts());
|
||||
string textToLower = text.ToLower();
|
||||
string textToLower = text.ToLowerInvariant();
|
||||
listViewNames.BeginUpdate();
|
||||
foreach (string name in _nameListInclMulti)
|
||||
{
|
||||
int startIndex = textToLower.IndexOf(name.ToLower(), StringComparison.Ordinal);
|
||||
int startIndex = textToLower.IndexOf(name.ToLowerInvariant(), StringComparison.Ordinal);
|
||||
if (startIndex >= 0)
|
||||
{
|
||||
while (startIndex >= 0 && startIndex < text.Length &&
|
||||
textToLower.Substring(startIndex).Contains(name.ToLower()) && name.Length > 1 && name != name.ToLower())
|
||||
textToLower.Substring(startIndex).Contains(name.ToLowerInvariant()) && name.Length > 1 && name != name.ToLower())
|
||||
{
|
||||
bool startOk = startIndex == 0 || "([ --'>\r\n¿¡\"”“„".Contains(text[startIndex - 1]);
|
||||
if (startOk)
|
||||
@ -175,7 +175,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
startIndex = textToLower.IndexOf(name.ToLower(), startIndex + 2, StringComparison.Ordinal);
|
||||
startIndex = textToLower.IndexOf(name.ToLowerInvariant(), startIndex + 2, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -200,10 +200,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
string text = UiUtil.GetStringFromListViewText(item.SubItems[2].Text);
|
||||
|
||||
string lower = text.ToLower();
|
||||
if (lower.Contains(name.ToLower()) && name.Length > 1 && name != name.ToLower())
|
||||
string lower = text.ToLowerInvariant();
|
||||
if (lower.Contains(name.ToLowerInvariant()) && name.Length > 1 && name != name.ToLowerInvariant())
|
||||
{
|
||||
int start = lower.IndexOf(name.ToLower(), StringComparison.Ordinal);
|
||||
int start = lower.IndexOf(name.ToLowerInvariant(), StringComparison.Ordinal);
|
||||
if (start >= 0)
|
||||
{
|
||||
bool startOk = start == 0 || lower[start - 1] == ' ' || lower[start - 1] == '-' || lower[start - 1] == '"' ||
|
||||
|
@ -75,7 +75,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
AddTextToRichTextBox(rtb, bold > 0, italic > 0, underline > 0, currentColor, sb.ToString());
|
||||
sb.Clear();
|
||||
string tag = GetTag(text.Substring(i).ToLower());
|
||||
string tag = GetTag(text.Substring(i).ToLowerInvariant());
|
||||
if (i + 1 < text.Length && text[i + 1] == '/')
|
||||
{
|
||||
if (tag == "</i>" && italic > 0)
|
||||
|
@ -737,7 +737,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
var empty = new Bitmap(width, height);
|
||||
imagesSavedCount++;
|
||||
string numberString = $"{imagesSavedCount:00000}";
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLower());
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLowerInvariant());
|
||||
SaveImage(empty, fileName, ImageFormat);
|
||||
|
||||
MessageBox.Show(string.Format(Configuration.Settings.Language.ExportPngXml.XImagesSavedInY, imagesSavedCount, folderBrowserDialog1.SelectedPath));
|
||||
@ -1085,7 +1085,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
return;
|
||||
}
|
||||
|
||||
xAndY = xAndY.ToLower();
|
||||
xAndY = xAndY.ToLowerInvariant();
|
||||
|
||||
if (_exportType == ExportFormats.Fcp)
|
||||
{
|
||||
@ -1257,7 +1257,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
if (!param.Saved)
|
||||
{
|
||||
string numberString = $"IMAGE{i:000}";
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLower());
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLowerInvariant());
|
||||
|
||||
if (checkBoxFullFrameImage.Visible && checkBoxFullFrameImage.Checked)
|
||||
{
|
||||
@ -1365,7 +1365,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
if (!param.Saved)
|
||||
{
|
||||
string numberString = $"IMAGE{i:000}";
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLower());
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLowerInvariant());
|
||||
SaveImage(param.Bitmap, fileName, ImageFormat);
|
||||
|
||||
imagesSavedCount++;
|
||||
@ -1386,7 +1386,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
if (!param.Saved)
|
||||
{
|
||||
string numberString = $"IMAGE{i:000}";
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLower());
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLowerInvariant());
|
||||
|
||||
foreach (var encoder in ImageCodecInfo.GetImageEncoders())
|
||||
{
|
||||
@ -1448,7 +1448,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
for (int k = lastFrame + 1; k < startFrame; k++)
|
||||
{
|
||||
string numberString = $"{k:00000}";
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLower());
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLowerInvariant());
|
||||
empty.Save(fileName, imageFormat);
|
||||
imagesSavedCount++;
|
||||
}
|
||||
@ -1469,7 +1469,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
for (int k = startFrame; k <= endFrame; k++)
|
||||
{
|
||||
string numberString = $"{k:00000}";
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLower());
|
||||
string fileName = Path.Combine(folderBrowserDialog1.SelectedPath, numberString + "." + comboBoxImageFormat.Text.ToLowerInvariant());
|
||||
fullSize.Save(fileName, imageFormat);
|
||||
imagesSavedCount++;
|
||||
}
|
||||
@ -1591,7 +1591,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
internal int WriteFcpParagraph(StringBuilder sb, int imagesSavedCount, MakeBitmapParameter param, int i, string fileName)
|
||||
{
|
||||
string numberString = string.Format(Path.GetFileNameWithoutExtension(Path.GetFileName(fileName)) + "{0:0000}", i).RemoveChar(' ');
|
||||
var fileNameShort = numberString + "." + comboBoxImageFormat.Text.ToLower();
|
||||
var fileNameShort = numberString + "." + comboBoxImageFormat.Text.ToLowerInvariant();
|
||||
var targetImageFileName = Path.Combine(Path.GetDirectoryName(fileName), fileNameShort);
|
||||
string fileNameNoPath = Path.GetFileName(fileNameShort);
|
||||
string fileNameNoExt = Path.GetFileNameWithoutExtension(fileNameNoPath);
|
||||
@ -1795,7 +1795,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
// <Graphic Width="696" Height="111" X="612" Y="930">subtitle_exp_0001.png</Graphic>
|
||||
//</Event>
|
||||
sb.AppendLine("<Event InTC=\"" + ToHHMMSSFF(param.P.StartTime) + "\" OutTC=\"" +
|
||||
ToHHMMSSFF(param.P.EndTime) + "\" Forced=\"" + param.Forced.ToString().ToLower() + "\">");
|
||||
ToHHMMSSFF(param.P.EndTime) + "\" Forced=\"" + param.Forced.ToString().ToLowerInvariant() + "\">");
|
||||
|
||||
int x = (width - param.Bitmap.Width) / 2;
|
||||
int y = height - (param.Bitmap.Height + param.BottomMargin);
|
||||
@ -2425,7 +2425,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
}
|
||||
else if (text.Substring(i).StartsWith("</font>", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (text.Substring(i).ToLower().Replace("</font>", string.Empty).Length > 0)
|
||||
if (text.Substring(i).ToLowerInvariant().Replace("</font>", string.Empty).Length > 0)
|
||||
{
|
||||
if (lastText.EndsWith(' ') && !sb.StartsWith(' '))
|
||||
{
|
||||
@ -3123,7 +3123,7 @@ $DROP=[DROPVALUE]" + Environment.NewLine + Environment.NewLine +
|
||||
}
|
||||
else if (text.Substring(i).StartsWith("</font>", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
if (text.Substring(i).ToLower().Replace("</font>", string.Empty).Length > 0)
|
||||
if (text.Substring(i).ToLowerInvariant().Replace("</font>", string.Empty).Length > 0)
|
||||
{
|
||||
if (lastText.EndsWith(' ') && !sb.StartsWith(' '))
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
DateTime start;
|
||||
double durationInSeconds;
|
||||
string ext = Path.GetExtension(VideoFileName).ToLower();
|
||||
string ext = Path.GetExtension(VideoFileName).ToLowerInvariant();
|
||||
if (ext == ".mp4" || ext == ".m4v" || ext == ".3gp")
|
||||
{
|
||||
MP4Parser mp4Parser = new MP4Parser(VideoFileName);
|
||||
|
@ -63,7 +63,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string temp = s.Replace("[", string.Empty).Replace("]", string.Empty);
|
||||
if (temp.Length > 4)
|
||||
{
|
||||
temp = temp.Substring(temp.Length - 5, 2).ToLower();
|
||||
temp = temp.Substring(temp.Length - 5, 2).ToLowerInvariant();
|
||||
|
||||
if (temp != defaultToLanguage)
|
||||
{
|
||||
|
@ -46,7 +46,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
if (text.Length > 1)
|
||||
{
|
||||
text = char.ToUpper(text[0]) + text.Substring(1).ToLower();
|
||||
text = char.ToUpper(text[0]) + text.Substring(1).ToLowerInvariant();
|
||||
}
|
||||
|
||||
Text = text;
|
||||
@ -161,7 +161,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
string temp = s.Replace("[", string.Empty).Replace("]", string.Empty);
|
||||
if (temp.Length > 4)
|
||||
{
|
||||
temp = temp.Substring(temp.Length - 5, 2).ToLower();
|
||||
temp = temp.Substring(temp.Length - 5, 2).ToLowerInvariant();
|
||||
if (temp != defaultFromLanguage && installedLanguages.Any(p => p.Culture.TwoLetterISOLanguageName.Contains(temp)))
|
||||
{
|
||||
uiCultureTargetLanguage = temp;
|
||||
@ -685,7 +685,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
if (!string.IsNullOrEmpty(videoFileName))
|
||||
{
|
||||
return Path.GetFileNameWithoutExtension(videoFileName) + "." + _targetTwoLetterIsoLanguageName.ToLower() + subtitleFormat.Extension;
|
||||
return Path.GetFileNameWithoutExtension(videoFileName) + "." + _targetTwoLetterIsoLanguageName.ToLowerInvariant() + subtitleFormat.Extension;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(oldFileName))
|
||||
@ -699,7 +699,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
s = s.Remove(s.Length - 3);
|
||||
}
|
||||
}
|
||||
return s + "." + _targetTwoLetterIsoLanguageName.ToLower() + subtitleFormat.Extension;
|
||||
return s + "." + _targetTwoLetterIsoLanguageName.ToLowerInvariant() + subtitleFormat.Extension;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -7835,9 +7835,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
var moreLanguages = new List<CultureInfo>();
|
||||
foreach (CultureInfo x in CultureInfo.GetCultures(CultureTypes.NeutralCultures))
|
||||
{
|
||||
var twoLetterLower = x.TwoLetterISOLanguageName.ToLower();
|
||||
var twoLetterLower = x.TwoLetterISOLanguageName.ToLowerInvariant();
|
||||
if (!languages.Contains(twoLetterLower) &&
|
||||
!languages.Contains(x.ThreeLetterISOLanguageName.ToLower()) &&
|
||||
!languages.Contains(x.ThreeLetterISOLanguageName.ToLowerInvariant()) &&
|
||||
twoLetterLower != "iv")
|
||||
{
|
||||
moreLanguages.Add(x);
|
||||
@ -9483,7 +9483,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
int start = textBoxListViewText.SelectionStart;
|
||||
int length = textBoxListViewText.SelectionLength;
|
||||
textBoxListViewText.SelectedText = textBoxListViewText.SelectedText.ToLower();
|
||||
textBoxListViewText.SelectedText = textBoxListViewText.SelectedText.ToLowerInvariant();
|
||||
textBoxListViewText.SelectionStart = start;
|
||||
textBoxListViewText.SelectionLength = length;
|
||||
e.SuppressKeyPress = true;
|
||||
@ -9492,7 +9492,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
int start = textBoxListViewText.SelectionStart;
|
||||
int length = textBoxListViewText.SelectionLength;
|
||||
textBoxListViewText.SelectedText = textBoxListViewText.SelectedText.ToUpper();
|
||||
textBoxListViewText.SelectedText = textBoxListViewText.SelectedText.ToUpperInvariant();
|
||||
textBoxListViewText.SelectionStart = start;
|
||||
textBoxListViewText.SelectionLength = length;
|
||||
e.SuppressKeyPress = true;
|
||||
@ -22241,7 +22241,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
int start = textBoxListViewTextAlternate.SelectionStart;
|
||||
int length = textBoxListViewTextAlternate.SelectionLength;
|
||||
textBoxListViewTextAlternate.SelectedText = textBoxListViewTextAlternate.SelectedText.ToLower();
|
||||
textBoxListViewTextAlternate.SelectedText = textBoxListViewTextAlternate.SelectedText.ToLowerInvariant();
|
||||
textBoxListViewTextAlternate.SelectionStart = start;
|
||||
textBoxListViewTextAlternate.SelectionLength = length;
|
||||
e.SuppressKeyPress = true;
|
||||
@ -22253,7 +22253,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
int start = textBoxListViewTextAlternate.SelectionStart;
|
||||
int length = textBoxListViewTextAlternate.SelectionLength;
|
||||
textBoxListViewTextAlternate.SelectedText = textBoxListViewTextAlternate.SelectedText.ToUpper();
|
||||
textBoxListViewTextAlternate.SelectedText = textBoxListViewTextAlternate.SelectedText.ToUpperInvariant();
|
||||
textBoxListViewTextAlternate.SelectionStart = start;
|
||||
textBoxListViewTextAlternate.SelectionLength = length;
|
||||
e.SuppressKeyPress = true;
|
||||
|
@ -1025,7 +1025,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
// try to match language from vob to Tesseract language
|
||||
if (comboBoxTesseractLanguages.SelectedIndex >= 0 && comboBoxTesseractLanguages.Items.Count > 1 && languageString != null)
|
||||
{
|
||||
languageString = languageString.ToLower();
|
||||
languageString = languageString.ToLowerInvariant();
|
||||
for (int i = 0; i < comboBoxTesseractLanguages.Items.Count; i++)
|
||||
{
|
||||
var tl = comboBoxTesseractLanguages.Items[i] as TesseractLanguage;
|
||||
@ -3108,14 +3108,14 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
if (_nocrLastLowercaseHeight > 3 && targetItem.NikseBitmap.Height - _nocrLastLowercaseHeight < 2)
|
||||
{
|
||||
result.Text = result.Text.ToLower();
|
||||
result.Text = result.Text.ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
else if (result.Text == "v" || result.Text == "w" || result.Text == "u" || result.Text == "s" || result.Text == "z" || result.Text == "o" || result.Text == "x" || result.Text == "ø" || result.Text == "c")
|
||||
{
|
||||
if (_nocrLastUppercaseHeight > 3 && _nocrLastUppercaseHeight - targetItem.NikseBitmap.Height < 2)
|
||||
{
|
||||
result.Text = result.Text.ToUpper();
|
||||
result.Text = result.Text.ToUpperInvariant();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3171,14 +3171,14 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
if (_nocrLastLowercaseHeight > 3 && targetItem.NikseBitmap.Height - _nocrLastLowercaseHeight < 2)
|
||||
{
|
||||
result.Text = result.Text.ToLower();
|
||||
result.Text = result.Text.ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
else if (result.Text == "v" || result.Text == "w" || result.Text == "u" || result.Text == "s" || result.Text == "z" || result.Text == "o" || result.Text == "x" || result.Text == "ø" || result.Text == "c")
|
||||
{
|
||||
if (_nocrLastUppercaseHeight > 3 && _nocrLastUppercaseHeight - targetItem.NikseBitmap.Height < 2)
|
||||
{
|
||||
result.Text = result.Text.ToUpper();
|
||||
result.Text = result.Text.ToUpperInvariant();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3229,14 +3229,14 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
if (p.NOcrLastLowercaseHeight > 3 && targetItem.NikseBitmap.Height - p.NOcrLastLowercaseHeight < 2)
|
||||
{
|
||||
result.Text = result.Text.ToLower();
|
||||
result.Text = result.Text.ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
else if (result.Text == "v" || result.Text == "w" || result.Text == "u" || result.Text == "s" || result.Text == "z" || result.Text == "o" || result.Text == "x" || result.Text == "ø" || result.Text == "c")
|
||||
{
|
||||
if (p.NOcrLastUppercaseHeight > 3 && p.NOcrLastUppercaseHeight - targetItem.NikseBitmap.Height < 2)
|
||||
{
|
||||
result.Text = result.Text.ToUpper();
|
||||
result.Text = result.Text.ToUpperInvariant();
|
||||
}
|
||||
}
|
||||
|
||||
@ -3460,14 +3460,14 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
{
|
||||
if (_binOcrLastLowercaseHeight > 3 && h - _binOcrLastLowercaseHeight < 2)
|
||||
{
|
||||
text = text.ToLower();
|
||||
text = text.ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
else if (text == "v" || text == "w" || text == "u" || text == "s" || text == "z" || text == "o" || text == "x" || text == "ø" || text == "c")
|
||||
{
|
||||
if (_binOcrLastUppercaseHeight > 3 && _binOcrLastUppercaseHeight - h < 2)
|
||||
{
|
||||
text = text.ToUpper();
|
||||
text = text.ToUpperInvariant();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -8738,7 +8738,7 @@ namespace Nikse.SubtitleEdit.Forms.Ocr
|
||||
string text = listBoxUnknownWords.SelectedItems[0].ToString();
|
||||
if (text.Contains(':'))
|
||||
{
|
||||
text = text.Substring(text.IndexOf(':') + 1).Trim().ToLower();
|
||||
text = text.Substring(text.IndexOf(':') + 1).Trim().ToLowerInvariant();
|
||||
using (var form = new AddToUserDic())
|
||||
{
|
||||
form.Initialize(comboBoxDictionaries.Text, text);
|
||||
|
@ -1984,7 +1984,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
|
||||
string language = GetCurrentWordListLanguage();
|
||||
string text = textBoxUserWord.Text.RemoveControlCharacters().Trim().ToLower();
|
||||
string text = textBoxUserWord.Text.RemoveControlCharacters().Trim().ToLowerInvariant();
|
||||
if (!string.IsNullOrEmpty(language) && text.Length > 0 && !_userWordList.Contains(text))
|
||||
{
|
||||
Utilities.AddToUserDictionary(text, language);
|
||||
@ -2505,7 +2505,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
|
||||
string shortcut = GetShortcut(e.Node.Text);
|
||||
|
||||
string[] parts = shortcut.ToLower().Split(new[] { '+' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
string[] parts = shortcut.ToLowerInvariant().Split(new[] { '+' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string k in parts)
|
||||
{
|
||||
if (k.Equals("CONTROL", StringComparison.OrdinalIgnoreCase))
|
||||
|
@ -445,10 +445,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
break;
|
||||
case SpellCheckAction.SkipAll:
|
||||
_noOfSkippedWords++;
|
||||
_skipAllList.Add(ChangeWord.ToUpper());
|
||||
_skipAllList.Add(ChangeWord.ToUpperInvariant());
|
||||
if (ChangeWord.EndsWith('\'') || ChangeWord.StartsWith('\''))
|
||||
{
|
||||
_skipAllList.Add(ChangeWord.ToUpper().Trim('\''));
|
||||
_skipAllList.Add(ChangeWord.ToUpperInvariant().Trim('\''));
|
||||
}
|
||||
|
||||
break;
|
||||
@ -599,8 +599,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
_noOfNames++;
|
||||
}
|
||||
else if (_skipAllList.Contains(_currentWord.ToUpper())
|
||||
|| (_currentWord.StartsWith('\'') || _currentWord.EndsWith('\'')) && _skipAllList.Contains(_currentWord.Trim('\'').ToUpper()))
|
||||
else if (_skipAllList.Contains(_currentWord.ToUpperInvariant())
|
||||
|| (_currentWord.StartsWith('\'') || _currentWord.EndsWith('\'')) && _skipAllList.Contains(_currentWord.Trim('\'').ToUpperInvariant()))
|
||||
{
|
||||
_noOfSkippedWords++;
|
||||
}
|
||||
@ -745,7 +745,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
else
|
||||
{
|
||||
if (_currentWord.ToUpper() != "LT'S" && _currentWord.ToUpper() != "SOX'S" && !_currentWord.ToUpper().StartsWith("HTTP", StringComparison.Ordinal)) // TODO: Get fixed nhunspell
|
||||
if (_currentWord.ToUpperInvariant() != "LT'S" && _currentWord.ToUpperInvariant() != "SOX'S" && !_currentWord.ToUpperInvariant().StartsWith("HTTP", StringComparison.Ordinal)) // TODO: Get fixed nhunspell
|
||||
{
|
||||
suggestions = DoSuggest(_currentWord); // TODO: 0.9.6 fails on "Lt'S"
|
||||
}
|
||||
@ -784,9 +784,9 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
if (AutoFixNames && _currentWord.Length > 1)
|
||||
{
|
||||
if (_currentWord.Length > 3 && suggestions.Contains(_currentWord.ToUpper()))
|
||||
if (_currentWord.Length > 3 && suggestions.Contains(_currentWord.ToUpperInvariant()))
|
||||
{ // does not work well with two letter words like "da" and "de" which get auto-corrected to "DA" and "DE"
|
||||
ChangeWord = _currentWord.ToUpper();
|
||||
ChangeWord = _currentWord.ToUpperInvariant();
|
||||
DoAction(SpellCheckAction.ChangeAll);
|
||||
return;
|
||||
}
|
||||
@ -1166,10 +1166,10 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
case SpellCheckAction.Skip:
|
||||
break;
|
||||
case SpellCheckAction.SkipAll:
|
||||
_skipAllList.Remove(undo.UndoWord.ToUpper());
|
||||
_skipAllList.Remove(undo.UndoWord.ToUpperInvariant());
|
||||
if (undo.UndoWord.EndsWith('\'') || undo.UndoWord.StartsWith('\''))
|
||||
{
|
||||
_skipAllList.Remove(undo.UndoWord.ToUpper().Trim('\''));
|
||||
_skipAllList.Remove(undo.UndoWord.ToUpperInvariant().Trim('\''));
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -137,7 +137,7 @@ https://github.com/SubtitleEdit/subtitleedit
|
||||
|
||||
var sb = new StringBuilder();
|
||||
int sourceLength = _subtitle.ToText(_format).Length;
|
||||
var allTextToLower = allText.ToString().ToLower();
|
||||
var allTextToLower = allText.ToString().ToLowerInvariant();
|
||||
|
||||
sb.AppendLine(string.Format(_l.NumberOfLinesX, _subtitle.Paragraphs.Count));
|
||||
sb.AppendLine(string.Format(_l.LengthInFormatXinCharactersY, _format.FriendlyName, sourceLength));
|
||||
|
@ -367,15 +367,15 @@ namespace Nikse.SubtitleEdit.Forms.Styles
|
||||
var sb = new StringBuilder();
|
||||
foreach (var line in _header.Split(Utilities.NewLineChars, StringSplitOptions.None))
|
||||
{
|
||||
string s = line.Trim().ToLower();
|
||||
string s = line.Trim().ToLowerInvariant();
|
||||
if (s.StartsWith("format:", StringComparison.Ordinal))
|
||||
{
|
||||
if (line.Length > 10)
|
||||
{
|
||||
var format = line.ToLower().Substring(8).Split(',');
|
||||
var format = line.ToLowerInvariant().Substring(8).Split(',');
|
||||
for (int i = 0; i < format.Length; i++)
|
||||
{
|
||||
string f = format[i].Trim().ToLower();
|
||||
string f = format[i].Trim().ToLowerInvariant();
|
||||
if (f == "name")
|
||||
{
|
||||
nameIndex = i;
|
||||
@ -847,8 +847,8 @@ namespace Nikse.SubtitleEdit.Forms.Styles
|
||||
var sb = new StringBuilder();
|
||||
foreach (var line in _header.Split(new[] { Environment.NewLine }, StringSplitOptions.None))
|
||||
{
|
||||
var lineIsStyle = line.ToLower().RemoveChar(' ').StartsWith("style:" + name.ToLower().RemoveChar(' ') + ",", StringComparison.Ordinal) &&
|
||||
line.ToLower().Contains(name.ToLower());
|
||||
var lineIsStyle = line.ToLowerInvariant().RemoveChar(' ').StartsWith("style:" + name.ToLowerInvariant().RemoveChar(' ') + ",", StringComparison.Ordinal) &&
|
||||
line.ToLowerInvariant().Contains(name.ToLowerInvariant());
|
||||
if (!lineIsStyle)
|
||||
{
|
||||
sb.AppendLine(line);
|
||||
|
@ -134,15 +134,15 @@ namespace Nikse.SubtitleEdit.Forms.Styles
|
||||
var sb = new StringBuilder();
|
||||
foreach (var line in _header.Split(Utilities.NewLineChars, StringSplitOptions.None))
|
||||
{
|
||||
string s = line.Trim().ToLower();
|
||||
string s = line.Trim().ToLowerInvariant();
|
||||
if (s.StartsWith("format:", StringComparison.Ordinal))
|
||||
{
|
||||
if (line.Length > 10)
|
||||
{
|
||||
var format = line.ToLower().Substring(8).Split(',');
|
||||
var format = line.ToLowerInvariant().Substring(8).Split(',');
|
||||
for (int i = 0; i < format.Length; i++)
|
||||
{
|
||||
string f = format[i].Trim().ToLower();
|
||||
string f = format[i].Trim().ToLowerInvariant();
|
||||
if (f == "name")
|
||||
{
|
||||
nameIndex = i;
|
||||
@ -746,8 +746,8 @@ namespace Nikse.SubtitleEdit.Forms.Styles
|
||||
scriptInfoOn = false;
|
||||
}
|
||||
|
||||
string s = line.ToLower();
|
||||
if (s.StartsWith(tag.ToLower() + ":"))
|
||||
string s = line.ToLowerInvariant();
|
||||
if (s.StartsWith(tag.ToLowerInvariant() + ":"))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
|
@ -255,8 +255,8 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
scriptInfoOn = false;
|
||||
}
|
||||
|
||||
string s = line.ToLower();
|
||||
if (s.StartsWith(tag.ToLower() + ":", StringComparison.Ordinal))
|
||||
string s = line.ToLowerInvariant();
|
||||
if (s.StartsWith(tag.ToLowerInvariant() + ":", StringComparison.Ordinal))
|
||||
{
|
||||
if (!remove)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
for (int i = 0; i < moreLanguages.Count; i++)
|
||||
{
|
||||
var language = moreLanguages[i];
|
||||
var code = language.TwoLetterISOLanguageName.ToLower();
|
||||
var code = language.TwoLetterISOLanguageName.ToLowerInvariant();
|
||||
comboBoxLanguage.Items.Add(new LanguageComboBoxItem(code, language.EnglishName + " / " + language.NativeName));
|
||||
if (code == currentLanguage)
|
||||
{
|
||||
|
@ -597,7 +597,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
using (var findSubtitle = new FindSubtitleLine())
|
||||
{
|
||||
findSubtitle.Initialize(_paragraphs, " " + "(" + _language.StartScene.ToLower() + ")");
|
||||
findSubtitle.Initialize(_paragraphs, " " + "(" + _language.StartScene.ToLowerInvariant() + ")");
|
||||
findSubtitle.ShowDialog();
|
||||
if (findSubtitle.SelectedIndex >= 0)
|
||||
{
|
||||
@ -610,7 +610,7 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
using (var findSubtitle = new FindSubtitleLine())
|
||||
{
|
||||
findSubtitle.Initialize(_paragraphs, " " + "(" + _language.EndScene.ToLower() + ")");
|
||||
findSubtitle.Initialize(_paragraphs, " " + "(" + _language.EndScene.ToLowerInvariant() + ")");
|
||||
findSubtitle.ShowDialog();
|
||||
if (findSubtitle.SelectedIndex >= 0)
|
||||
{
|
||||
|
@ -937,7 +937,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
}
|
||||
else
|
||||
{
|
||||
return argument.Substring(1).ToLower();
|
||||
return argument.Substring(1).ToLowerInvariant();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -238,7 +238,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
bool isEnglish = threeLetterIsoLanguageName.Equals("eng", StringComparison.OrdinalIgnoreCase);
|
||||
foreach (string name in _nameList)
|
||||
{
|
||||
_nameListUppercase.Add(name.ToUpper());
|
||||
_nameListUppercase.Add(name.ToUpperInvariant());
|
||||
if (isEnglish)
|
||||
{
|
||||
if (!name.EndsWith('s'))
|
||||
@ -1407,7 +1407,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
}
|
||||
|
||||
string wordWithCasingChanged = GetWordWithDominatedCasing(word);
|
||||
if (DoSpell(word.ToLower()))
|
||||
if (DoSpell(word.ToLowerInvariant()))
|
||||
{
|
||||
guesses.Insert(0, wordWithCasingChanged);
|
||||
}
|
||||
@ -1484,7 +1484,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
}
|
||||
else
|
||||
{
|
||||
if (word.ToUpper() != "LT'S" && word.ToUpper() != "SOX'S") // TODO: Get fixed nhunspell
|
||||
if (word.ToUpperInvariant() != "LT'S" && word.ToUpperInvariant() != "SOX'S") // TODO: Get fixed nhunspell
|
||||
{
|
||||
suggestions = DoSuggest(word); // 0.9.6 fails on "Lt'S"
|
||||
}
|
||||
@ -1560,10 +1560,10 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
}
|
||||
if (uppercase > lowercase)
|
||||
{
|
||||
return word.ToUpper();
|
||||
return word.ToUpperInvariant();
|
||||
}
|
||||
|
||||
return word.ToLower();
|
||||
return word.ToLowerInvariant();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -1584,8 +1584,8 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
case OcrSpellCheck.Action.AddToUserDictionary:
|
||||
if (_userWordListXmlFileName != null)
|
||||
{
|
||||
Utilities.AddToUserDictionary(_spellCheck.Word.Trim().ToLower(), _fiveLetterWordListLanguageName);
|
||||
_userWordList.Add(_spellCheck.Word.Trim().ToLower());
|
||||
Utilities.AddToUserDictionary(_spellCheck.Word.Trim().ToLowerInvariant(), _fiveLetterWordListLanguageName);
|
||||
_userWordList.Add(_spellCheck.Word.Trim().ToLowerInvariant());
|
||||
}
|
||||
result.Word = _spellCheck.Word;
|
||||
result.Fixed = true;
|
||||
@ -1611,7 +1611,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
else
|
||||
{
|
||||
_nameList.Add(s);
|
||||
_nameListUppercase.Add(s.ToUpper());
|
||||
_nameListUppercase.Add(s.ToUpperInvariant());
|
||||
if (_fiveLetterWordListLanguageName.StartsWith("en", StringComparison.Ordinal))
|
||||
{
|
||||
if (!s.EndsWith('s'))
|
||||
@ -1677,7 +1677,7 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
break;
|
||||
case OcrSpellCheck.Action.SkipAll:
|
||||
_wordSkipList.Add(_spellCheck.Word);
|
||||
_wordSkipList.Add(_spellCheck.Word.ToUpper());
|
||||
_wordSkipList.Add(_spellCheck.Word.ToUpperInvariant());
|
||||
if (_spellCheck.Word.Length > 1)
|
||||
{
|
||||
_wordSkipList.Add(char.ToUpper(_spellCheck.Word[0]) + _spellCheck.Word.Substring(1));
|
||||
@ -1734,15 +1734,15 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
if (ar[0].Length > 3 && ar[1].Length > 3)
|
||||
{
|
||||
string a = ar[0];
|
||||
if (a == a.ToUpper())
|
||||
if (a == a.ToUpperInvariant())
|
||||
{
|
||||
a = a[0] + a.Substring(1).ToLower();
|
||||
a = a[0] + a.Substring(1).ToLowerInvariant();
|
||||
}
|
||||
|
||||
string b = ar[0];
|
||||
if (b == b.ToUpper())
|
||||
if (b == b.ToUpperInvariant())
|
||||
{
|
||||
b = b[0] + b.Substring(1).ToLower();
|
||||
b = b[0] + b.Substring(1).ToLowerInvariant();
|
||||
}
|
||||
|
||||
if ((DoSpell(a) || IsWordKnownOrNumber(a, word)) &&
|
||||
@ -1781,12 +1781,12 @@ namespace Nikse.SubtitleEdit.Logic.Ocr
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_userWordList.Contains(word.ToLower()))
|
||||
if (_userWordList.Contains(word.ToLowerInvariant()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (_userWordList.Contains(word.Trim('\'').ToLower()))
|
||||
if (_userWordList.Contains(word.Trim('\'').ToLowerInvariant()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -350,7 +350,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
{
|
||||
foreach (Keys val in Enum.GetValues(typeof(Keys)))
|
||||
{
|
||||
string k = val.ToString().ToLower();
|
||||
string k = val.ToString().ToLowerInvariant();
|
||||
if (!AllKeys.ContainsKey(k))
|
||||
{
|
||||
AllKeys.Add(k, val);
|
||||
@ -372,7 +372,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
}
|
||||
}
|
||||
|
||||
string[] parts = keysInString.ToLower().Split(new[] { '+' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
string[] parts = keysInString.ToLowerInvariant().Split(new[] { '+' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
var resultKeys = Keys.None;
|
||||
foreach (string k in parts)
|
||||
{
|
||||
|
@ -139,7 +139,7 @@ namespace Nikse.SubtitleEdit.Logic.VideoPlayers
|
||||
{
|
||||
const int wsChild = 0x40000000;
|
||||
|
||||
string ext = System.IO.Path.GetExtension(videoFileName).ToLower();
|
||||
string ext = System.IO.Path.GetExtension(videoFileName).ToLowerInvariant();
|
||||
bool isAudio = ext == ".mp3" || ext == ".wav" || ext == ".wma" || ext == ".ogg" || ext == ".mpa" || ext == ".m4a" || ext == ".ape" || ext == ".aiff" || ext == ".flac" || ext == ".aac" || ext == ".ac3" || ext == ".mka";
|
||||
|
||||
OnVideoLoaded = onVideoLoaded;
|
||||
|
Loading…
Reference in New Issue
Block a user