It seems in order to open an UTF-8 file, one has to explicitly specify the
encoding method. Currently, the way around this is to provide fromCSV
method with a file hander.
The following lines will read the utf-8 file correctly. We probably will
need to provide encoding as an option parameter to the fromFile/fromCSV
method in the future.
open(my $fh, '< :encoding(utf8)', "sample.utf8.csv");
my $t1=Data::Table::fromCSV($fh, 1);
On Mon, Dec 16, 2013 at 4:19 PM, Sérgio Basto via RT <
bug-Data-Table-Excel@rt.cpan.org> wrote:
Show quoted text> Queue: Data-Table-Excel
> Ticket <URL:
https://rt.cpan.org/Ticket/Display.html?id=91190 >
>
>
> Samples , see that utf-8 tab have a bad characters .
> Seems a problem of Data::Table::fromFile ...
>
> btw , I managed to not use Class::CSV , and do Tables directly with
> something like :
>
> my $table = new Data::Table($data, $header, 0);
> Data::Table::Excel::tables2xlsx("$file", [$table], ["tab name"],
> [["white","silver","gray"]]);
>
> and don't need enconding tricks anymore , works with utf-8 .
>
> So I solved my problem.
>
> Thks for this great perl module
>