# Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
-# Copyright (C) 2001-2003 Craig Barratt
+# Copyright (C) 2001-2007 Craig Barratt
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
#========================================================================
#
-# Version 2.1.0beta2, released 23 May 2004.
+# Version 3.1.0, released 25 Nov 2007.
#
# See http://backuppc.sourceforge.net.
#
use Carp;
use File::Path;
use BackupPC::FileZIO;
+use Encode qw/from_to/;
require Exporter;
use vars qw( @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS );
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";
}
}
(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 ) {