Jun 272010
Wide character in print... warning in Perl
Answer:
Assume you have a simple script that print out UTF-8 characters in your script.
E.g.
#!/usr/bin/perl
my $foo = "Hello \x{4E2D} \x{570B}\n";
print $foo;
When you run it, it will give out warnings...
Wide character in print at test.pl line 5.
Hello 中 國
To fix for the problem, add the line at the top of your program.
use encoding "utf-8";