@@ -457,6 +457,7 @@ use File::Basename;
457457use File::Spec::Functions qw(file_name_is_absolute abs2rel rel2abs catdir catfile);
458458use Cwd (); # to help Debian packaging
459459use Config;
460+ use Encode;
460461
461462our $pager = $ENV {PERLDOC_PAGER} // $ENV {PAGER} // $Config {pager};
462463
@@ -781,6 +782,7 @@ sub decodedb {
781782 while (read $fh , my $plen , 2) {
782783 my ($len ) = unpack "v", $plen ;
783784 read $fh , my($txt ), $len ;
785+ $txt = Encode::decode('UTF-8', $txt );
784786 my ($sym , $module , @a ) = split chr(0), $txt ;
785787 push @a , "" if @a % 2; # Add null string at end if necessary -- solves bug with missing REF section.
786788 $hash {$sym }{$module } = { @a , Dbfile => $filename }; # keep the origin pdldoc.db path
@@ -825,7 +827,7 @@ sub encodedb {
825827 #store paths to *.pm files relative to pdldoc.db
826828 if file_name_is_absolute($fi ) && -f $fi ;
827829 delete $val ->{Dbfile}; # no need to store Dbfile
828- my $txt = join( chr(0),$name ,$module ,map +($_ =>$val ->{$_ }), sort keys %$val );
830+ my $txt = Encode::encode('UTF-8', join chr(0),$name ,$module ,map +($_ =>$val ->{$_ }), sort keys %$val );
829831 print $fh pack("v",length($txt )).$txt ;
830832 }
831833 }
0 commit comments