First, I would strongly recommend against using any of the functions from the utf8 module, since these are really only meant for use if one knows the inner workings of how Perl handles Unicode and non-Unicode strings. Second, it seems binmodeing STDIN is not enough - instead, try the open pragma with the :std option <update> since that also sets the default open modes and works on files passed on the command line as well </update>. The following works for me, both for a UTF-8 file piped into perl and a file listed on the command line:
use warnings; use strict; use open qw/:std :utf8/; use HTML::Entities; while(<>) { chomp; print lc(decode_entities($_)), "\n"; }
Update: Added a missing "not", oops :-)
In reply to Re^3: Unexpected interaction between decode_entities() and lc()
by haukex
in thread Unexpected interaction between decode_entities() and lc()
by kurisuto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |