mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-23 03:33:18 +01:00
Merge pull request #2492 from ivandrofly/language-detector
[LanguageAutoDetect] - Only call DetectAnsiEncoding after all checks to avoid redundant process
This commit is contained in:
commit
9f2eb1c732
@ -855,8 +855,6 @@ namespace Nikse.SubtitleEdit.Core
|
||||
}
|
||||
else if (Configuration.Settings.General.AutoGuessAnsiEncoding)
|
||||
{
|
||||
encoding = DetectAnsiEncoding(buffer);
|
||||
|
||||
Encoding greekEncoding = Encoding.GetEncoding(1253); // Greek
|
||||
if (GetCount(greekEncoding.GetString(buffer), AutoDetectWordsGreek) > 5)
|
||||
return greekEncoding;
|
||||
@ -892,6 +890,8 @@ namespace Nikse.SubtitleEdit.Core
|
||||
Encoding koreanEncoding = Encoding.GetEncoding(949); // Korean
|
||||
if (GetCount(koreanEncoding.GetString(buffer), "그리고", "아니야", "하지만", "말이야", "그들은", "우리가") > 5)
|
||||
return koreanEncoding;
|
||||
|
||||
return DetectAnsiEncoding(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user