aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs')
-rw-r--r--Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs18
1 files changed, 9 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs
index 050a9d9ce..eac67fe95 100644
--- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs
+++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/Core/EUCJPProber.cs
@@ -43,25 +43,25 @@ namespace UniversalDetector.Core
private EUCJPContextAnalyser contextAnalyser;
private EUCJPDistributionAnalyser distributionAnalyser;
private byte[] lastChar = new byte[2];
-
+
public EUCJPProber()
{
codingSM = new CodingStateMachine(new EUCJPSMModel());
distributionAnalyser = new EUCJPDistributionAnalyser();
- contextAnalyser = new EUCJPContextAnalyser();
+ contextAnalyser = new EUCJPContextAnalyser();
Reset();
}
- public override string GetCharsetName()
+ public override string GetCharsetName()
{
return "EUC-JP";
}
-
+
public override ProbingState HandleData(byte[] buf, int offset, int len)
{
int codingState;
int max = offset + len;
-
+
for (int i = offset; i < max; i++) {
codingState = codingSM.NextState(buf[i]);
if (codingState == SMModel.ERROR) {
@@ -83,7 +83,7 @@ namespace UniversalDetector.Core
distributionAnalyser.HandleOneChar(buf, i-1, charLen);
}
}
- }
+ }
lastChar[0] = buf[max-1];
if (state == ProbingState.Detecting)
if (contextAnalyser.GotEnoughData() && GetConfidence() > SHORTCUT_THRESHOLD)
@@ -93,18 +93,18 @@ namespace UniversalDetector.Core
public override void Reset()
{
- codingSM.Reset();
+ codingSM.Reset();
state = ProbingState.Detecting;
contextAnalyser.Reset();
distributionAnalyser.Reset();
}
-
+
public override float GetConfidence()
{
float contxtCf = contextAnalyser.GetConfidence();
float distribCf = distributionAnalyser.GetConfidence();
return (contxtCf > distribCf ? contxtCf : distribCf);
}
-
+
}
}