in reply to Unicode in bz2 compressed files

perlunitut: Unicode in Perl#Decoding

use Encode; ... while( my $bytesread = $bz->bzreadline(my $line) ){ $bytesread ==-1 and warn sprintf "Error: $bz->bzreadline : %d : %s +", $bz->bzerror, $bz->bzerror; $line = decode('utf8', $line ); ... }

See also perluniintro, Encode...

Replies are listed 'Best First'.
Re^2: Unicode in bz2 compressed files
by Anonymous Monk on Sep 05, 2011 at 08:51 UTC

    Thank you, wise friend.

    Although I had read the tutorials, I hadn't quite understood what this manual encoding and decoding was about, and how it applied in my case. Your example has made it clear to me.