in reply to Re: UTF-8 issues with Perl in general and with Spreadsheet::WriteExcel
in thread UTF-8 issues with Perl in general and with Spreadsheet::WriteExcel

Thank you, that sounds convincing.

I tried simply adding "<:utf8" to the open command in the Spreadsheet:WriteExcel script and it seems to have fixed the problem.

I understand how the same concept applies to input from STDIN in the first script, but I don't understand the actual code. Why is the while loop necessary and what do I put inside the loop? And what's the scope of "binmode STDIN..."? All that follows or just the next instance when STDIN is used? (i.e. do I just include it once at the start of the script or before each input from STDIN? - your post seems to suggest I need to add this line every time I expect input with fancy characters.)

  • Comment on Re^2: UTF-8 issues with Perl in general and with Spreadsheet::WriteExcel

Replies are listed 'Best First'.
Re^3: UTF-8 issues with Perl in general and with Spreadsheet::WriteExcel
by almut (Canon) on Jul 16, 2010 at 11:05 UTC
    do I just include it once at the start of the script or before each input from STDIN?

    Including it once is sufficient.  It adds another PerlIO layer to the file handle (STDIN here), which remains in effect for the lifetime of the file handle (or until you change it again with another binmode).