in reply to UTF-8 issues with Perl in general and with Spreadsheet::WriteExcel
So, whenever you read something form STDIN, also do
binmode STDIN, ':encoding(UTF-8)'; # then you can do: while (<STDIN>) { # work with $_ here }
This decodes the input. Then use utf8; to tell perl that your script is written in UTF-8 (note that ASCII is a valid subset of UTF-8).
Test that your terminal actually understands UTF-8, as described in this article, which also might be of general interest for you.
SpreadSheet::WriteExcel works correctly if you supply it with decoded text strings.
Update: clarified what I mean with the while-loop.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: UTF-8 issues with Perl in general and with Spreadsheet::WriteExcel
by elef (Friar) on Jul 16, 2010 at 10:19 UTC | |
by almut (Canon) on Jul 16, 2010 at 11:05 UTC | |
|
Re^2: UTF-8 issues with Perl in general and with Spreadsheet::WriteExcel
by elef (Friar) on Jul 16, 2010 at 15:20 UTC | |
by moritz (Cardinal) on Jul 16, 2010 at 16:52 UTC |