aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs
diff options
context:
space:
mode:
authorErwin de Haan <EraYaN@users.noreply.github.com>2019-01-11 12:50:36 +0100
committerErwin de Haan <EraYaN@users.noreply.github.com>2019-01-11 12:50:36 +0100
commite2751d42e8775596b7c4b929fd004d879f980947 (patch)
treeda1d6e703abbb6a47cd64730603f06dc4b51df8f /Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs
parentec1f5dc317182582ebff843c9e8a4d5277405469 (diff)
parente5c2dbdf23267006ef151d6ee8ab1cea147123d7 (diff)
Merge branch 'dev' into code-cleanup
Diffstat (limited to 'Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs')
-rw-r--r--Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs28
1 files changed, 14 insertions, 14 deletions
diff --git a/Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs b/Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs
index f2cecd03a..922239c54 100644
--- a/Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs
+++ b/Emby.Server.Implementations/TextEncoding/UniversalDetector/CharsetDetector.cs
@@ -41,7 +41,7 @@ using System.IO;
namespace UniversalDetector
{
/// <summary>
- /// Default implementation of charset detection interface.
+ /// Default implementation of charset detection interface.
/// The detector can be fed by a System.IO.Stream:
/// <example>
/// <code>
@@ -52,9 +52,9 @@ namespace UniversalDetector
/// Console.WriteLine("{0}, {1}", cdet.Charset, cdet.Confidence);
/// </code>
/// </example>
- ///
+ ///
/// or by a byte a array:
- ///
+ ///
/// <example>
/// <code>
/// byte[] buff = new byte[1024];
@@ -64,23 +64,23 @@ namespace UniversalDetector
/// cdet.DataEnd();
/// Console.WriteLine("{0}, {1}", cdet.Charset, cdet.Confidence);
/// </code>
- /// </example>
- /// </summary>
+ /// </example>
+ /// </summary>
public class CharsetDetector : Core.UniversalDetector, ICharsetDetector
{
private string charset;
-
+
private float confidence;
-
+
//public event DetectorFinished Finished;
-
+
public CharsetDetector() : base(FILTER_ALL)
{
-
+
}
public void Feed(Stream stream)
- {
+ {
byte[] buff = new byte[1024];
int read;
while ((read = stream.Read(buff, 0, buff.Length)) > 0 && !done)
@@ -88,12 +88,12 @@ namespace UniversalDetector
Feed(buff, 0, read);
}
}
-
- public bool IsDone()
+
+ public bool IsDone()
{
return done;
}
-
+
public override void Reset()
{
this.charset = null;
@@ -114,7 +114,7 @@ namespace UniversalDetector
// }
}
}
-
+
//public delegate void DetectorFinished(string charset, float confidence);
}