Skip to content

Commit 4499f9f

Browse files
committed
Added the Ude nuget. Uncommented the code that was calling Ude methods.
1 parent 2d48a9f commit 4499f9f

File tree

5 files changed

+33
-24
lines changed

5 files changed

+33
-24
lines changed

FileSplitStrategyEngine/Common.cs

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using System;
22
using System.Drawing;
33
using System.Reflection;
4+
using System.Globalization;
5+
using System.IO;
6+
using System.Text;
47
using System.Runtime.InteropServices;
58

69
namespace Datakido.FileSplitStrategyEngine
710
{
8-
using System.Globalization;
9-
using System.IO;
10-
using System.Text;
11-
1211
/// <exclude/>
1312
public class Common
1413
{
@@ -81,22 +80,22 @@ public static TextEncodingMetadata GetFileEncoding(string sourceFile)
8180

8281
metaData.HasBom = metaInfo.HasBom;
8382

84-
//using (FileStream fs = File.OpenRead(sourceFile))
85-
//{
86-
// var cdet = new Ude.CharsetDetector();
87-
// cdet.Feed(fs);
88-
// cdet.DataEnd();
89-
90-
// if (cdet.Charset != null)
91-
// {
92-
// metaData.CharacterSet = cdet.Charset;
93-
// metaData.DetectionConfidence = cdet.Confidence;
94-
// }
95-
// else
96-
// {
97-
// Console.WriteLine("Detection failed.");
98-
// }
99-
//}
83+
using (FileStream fs = File.OpenRead(sourceFile))
84+
{
85+
var cdet = new Ude.CharsetDetector();
86+
cdet.Feed(fs);
87+
cdet.DataEnd();
88+
89+
if (cdet.Charset != null)
90+
{
91+
metaData.CharacterSet = cdet.Charset;
92+
metaData.DetectionConfidence = cdet.Confidence;
93+
}
94+
else
95+
{
96+
Console.WriteLine("Detection failed.");
97+
}
98+
}
10099

101100
using (var sr = new StreamReader(sourceFile))
102101
{

FileSplitStrategyEngine/EncodingMetaInfo.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-

1+
using System.Text;
2+
23
namespace Datakido.FileSplitStrategyEngine
34
{
4-
using System.Text;
5-
65
/// <summary>
76
/// Holds information about a file's encoding.
87
/// </summary>

FileSplitStrategyEngine/FileSplitStrategyEngine.csproj

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@
7878
<Reference Include="System.ComponentModel.Composition" />
7979
<Reference Include="System.Drawing" />
8080
<Reference Include="System.Windows.Forms" />
81+
<Reference Include="Ude, Version=0.1.0.0, Culture=neutral, processorArchitecture=MSIL">
82+
<HintPath>..\packages\UDE.CSharp.1.1.0\lib\Ude.dll</HintPath>
83+
<Private>True</Private>
84+
</Reference>
8185
</ItemGroup>
8286
<ItemGroup>
8387
<Compile Include="..\GlobalAssemblyInfo.cs">
@@ -113,6 +117,9 @@
113117
<Install>true</Install>
114118
</BootstrapperPackage>
115119
</ItemGroup>
120+
<ItemGroup>
121+
<None Include="packages.config" />
122+
</ItemGroup>
116123
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
117124
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
118125
Other similar extension points exist, see Microsoft.Common.targets.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="UDE.CSharp" version="1.1.0" targetFramework="net40" />
4+
</packages>

GlobalAssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// associated with an assembly.
77
[assembly: AssemblyProduct("Datakido's Text File Splitter")]
88
[assembly: AssemblyCompany("Datakido")]
9-
[assembly: AssemblyCopyright("Copyright © SystemWidgets 2007-2013 : Datakido 2013-2016")]
9+
[assembly: AssemblyCopyright("Copyright © SystemWidgets 2007-2013 : Datakido 2014-2017")]
1010

1111
// Version information for an assembly consists of the following four values:
1212
//

0 commit comments

Comments
 (0)