perlquestion
mellin
Hi,
<p>I have a problem with the Perl module Excel::Writer::XLSX and certain characters such as Ä and Ö in the finnish Alphabet. They seem to become gibberish in the resulting file. I'm running the Perl script in Centos 6.3 and I've viewed the Excel file both in Windows 7 with Office 2010 and in Centos using LibreOffice Calc. Same problem in both. Any ideas what I might be doing wrong?</p>
<p>I have included a short code example below which produces the same issue in my system.</p>
<code>#!/usr/bin/perl -w
use strict;
use Excel::Writer::XLSX;
my $path = '/tmp';
my $time = time();
my $stamp = $time . '-' . $$;
my $filename = "$path/$stamp.xlsx";
# Create a new Excel workbook
my $workbook = Excel::Writer::XLSX->new($filename);
# Add a worksheet
my $worksheet = $workbook->add_worksheet();
# set header format
my $format = $workbook->add_format( bold => 1, color => 'black');
$worksheet->write(0, 0, 'Name', $format);
$worksheet->write(1, 0, 'Mister Mister');
$worksheet->write(2, 0, 'Mäster Mäster');
$worksheet->autofilter(0, 0, 2, 0);
$worksheet->freeze_panes(1, 0);</code>