File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
Source/FikaAmazonAPI/ReportGeneration Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
using FikaAmazonAPI . ReportGeneration . ReportDataTable ;
2
2
using System . Collections . Generic ;
3
+ using System . Text ;
3
4
4
5
namespace FikaAmazonAPI . ReportGeneration
5
6
{
6
7
public class ProductsReport
7
8
{
8
9
public List < ProductsRow > Data { get ; set ; } = new List < ProductsRow > ( ) ;
9
- public ProductsReport ( string path , string refNumber )
10
+ public ProductsReport ( string path , string refNumber , Encoding encoding = default )
10
11
{
11
12
if ( string . IsNullOrEmpty ( path ) )
12
13
return ;
13
14
14
- var table = Table . ConvertFromCSV ( path ) ;
15
+ var table = Table . ConvertFromCSV ( path , encoding : encoding ) ;
15
16
16
17
List < ProductsRow > values = new List < ProductsRow > ( ) ;
17
18
foreach ( var row in table . Rows )
Original file line number Diff line number Diff line change @@ -48,9 +48,9 @@ public Table(params string[] header)
48
48
this . header = header ;
49
49
}
50
50
51
- public static Table ConvertFromCSV ( string path , char separator = '\t ' )
51
+ public static Table ConvertFromCSV ( string path , char separator = '\t ' , Encoding encoding = default )
52
52
{
53
- var lines = File . ReadAllLines ( path ) ;
53
+ var lines = File . ReadAllLines ( path , encoding ?? Encoding . UTF8 ) ;
54
54
55
55
var table = new Table ( lines . First ( ) . Split ( separator ) ) ;
56
56
You can’t perform that action at this time.
0 commit comments