aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs')
-rw-r--r--Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs20
1 files changed, 14 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs
index f457bf490..e8da73c1c 100644
--- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs
+++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EscCharsetProber.cs
@@ -67,22 +67,30 @@ namespace UniversalDetector.Core
{
int max = offset + len;
- for (int i = offset; i < max && state == ProbingState.Detecting; i++) {
- for (int j = activeSM - 1; j >= 0; j--) {
+ for (int i = offset; i < max && state == ProbingState.Detecting; i++)
+ {
+ for (int j = activeSM - 1; j >= 0; j--)
+ {
// byte is feed to all active state machine
int codingState = codingSM[j].NextState(buf[i]);
- if (codingState == SMModel.ERROR) {
+ if (codingState == SMModel.ERROR)
+ {
// got negative answer for this state machine, make it inactive
activeSM--;
- if (activeSM == 0) {
+ if (activeSM == 0)
+ {
state = ProbingState.NotMe;
return state;
- } else if (j != activeSM) {
+ }
+ else if (j != activeSM)
+ {
CodingStateMachine t = codingSM[activeSM];
codingSM[activeSM] = codingSM[j];
codingSM[j] = t;
}
- } else if (codingState == SMModel.ITSME) {
+ }
+ else if (codingState == SMModel.ITSME)
+ {
state = ProbingState.FoundIt;
detectedCharset = codingSM[j].ModelName;
return state;