bluewhale has asked for the wisdom of the Perl Monks concerning the following question:
my $count=0; foreach my $row (@items) { my $id = @$row[0]; my $name = @$row[1]; $logger->debug("INITIAL ID: $id"); $logger->debug("INITIAL Name: $name"); eval {Encode::from_to($name, 'utf-16le', 'utf-8', Encode::FB_CROA +K);}; #eval {Encode::from_to($name, 'ucs-2', 'utf-8', Encode::FB_CROAK) +;}; if ($@) { my $error_message = qq(Can Not Encode to UTF-8: $@); $logger->debug("$error_message"); # Log out $error_messag +e } print <<"END"; $name END $count=$count+1; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Encoding problem in perl
by ikegami (Patriarch) on Jul 30, 2009 at 21:14 UTC | |
|
Re: Encoding problem in perl
by moritz (Cardinal) on Jul 30, 2009 at 21:01 UTC |