X-Git-Url: http://git.rot13.org//?a=blobdiff_plain;f=lib%2FBackupPC%2FAttrib.pm;h=2a76244f2ef9353b79d7991f3353542b9beb4393;hb=16755c17628b28a58d75663d7541036344826961;hp=4618c69f277b41f678d512aa2830cddefc28b04e;hpb=3f3d4f4adbd990e15969d9cbc5e99e89e613e502;p=BackupPC.git diff --git a/lib/BackupPC/Attrib.pm b/lib/BackupPC/Attrib.pm index 4618c69..2a76244 100644 --- a/lib/BackupPC/Attrib.pm +++ b/lib/BackupPC/Attrib.pm @@ -43,6 +43,7 @@ use strict; use Carp; use File::Path; use BackupPC::FileZIO; +use Encode; require Exporter; use vars qw( @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS ); @@ -198,6 +199,8 @@ sub read my($data); $file = $a->fileName($dir, $file); + from_to($file, "utf8", $a->{charsetLegacy}) + if ( $a->{charsetLegacy} ne "" ); my $fd = BackupPC::FileZIO->open($file, 0, $a->{compress}); if ( !$fd ) { $a->{_errStr} = "Can't open $file"; @@ -240,6 +243,8 @@ sub read } } (my $fileName, $data) = unpack("a$len a*", $data); + from_to($fileName, $a->{charsetLegacy}, "utf8") + if ( $a->{charsetLegacy} ne "" ); my $nFldsW = @FldsUnixW; my $nFldsN = @FldsUnixN; if ( length($data) < 5 * $nFldsW + 4 * $nFldsN ) {