projects
/
MojoFacets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix support for cp1250 encoded files
[MojoFacets.git]
/
lib
/
MojoFacets
/
Import
/
CSV.pm
diff --git
a/lib/MojoFacets/Import/CSV.pm
b/lib/MojoFacets/Import/CSV.pm
index
41c168a
..
5a83884
100644
(file)
--- a/
lib/MojoFacets/Import/CSV.pm
+++ b/
lib/MojoFacets/Import/CSV.pm
@@
-5,10
+5,9
@@
use strict;
use base 'Mojo::Base';
use base 'Mojo::Base';
-use HTML::TableExtract;
use File::Slurp;
use Data::Dump qw(dump);
use File::Slurp;
use Data::Dump qw(dump);
-use
JSON
;
+use
Encode
;
__PACKAGE__->attr('path');
__PACKAGE__->attr('full_path');
__PACKAGE__->attr('path');
__PACKAGE__->attr('full_path');
@@
-18,7
+17,8
@@
sub data {
my $path = $self->path;
my $path = $self->path;
- my $data = read_file $self->full_path, { binmode => ':cp1250' }; # FIXME configurable!
+ my $data = read_file $self->full_path, { binmode => ':raw' }; # FIXME configurable!
+ $data = decode('cp1250', $data);
my @lines = split(/\r?\n/, $data);
$data = { items => [] };
my @lines = split(/\r?\n/, $data);
$data = { items => [] };