- added utf8 to output filter and added encoding of file names
[BackupPC.git] / lib / BackupPC / CGI / Browse.pm
index df4f4d0..c16307a 100644 (file)
@@ -28,7 +28,7 @@
 #
 #========================================================================
 #
-# Version 2.1.0beta2, released 23 May 2004.
+# Version 3.0.0alpha, released 23 Jan 2006.
 #
 # See http://backuppc.sourceforge.net.
 #
@@ -37,6 +37,7 @@
 package BackupPC::CGI::Browse;
 
 use strict;
+use Encode;
 use BackupPC::CGI::Lib qw(:all);
 use BackupPC::View;
 use BackupPC::Attrib qw(:all);
@@ -156,6 +157,7 @@ sub action
                }
                my $dirName = $f;
                $dirName =~ s/ / /g;
+                $dirName = decode_utf8($dirName);
                push(@DirStr, {needTick => 1,
                                tdArgs   => " class=\"$tdStyle\"",
                               link     => <<EOF});
@@ -215,6 +217,7 @@ EOF
                     $attrStr .= "<td colspan=\"5\" align=\"center\" class=\"fviewborder\"> </td>\n";
                 }
                (my $fDisp = "${EscHTML($f)}") =~ s/ /&nbsp;/g;
+                $fDisp = decode_utf8($fDisp);
                 if ( $gotDir ) {
                     $fileStr .= <<EOF;
 <tr><td class="fviewborder">
@@ -255,6 +258,7 @@ EOF
     $dirDisplay =~ s{//+}{/}g;
     $dirDisplay =~ s{/+$}{}g;
     $dirDisplay = "/" if ( $dirDisplay eq "" );
+    $dirDisplay = decode_utf8($dirDisplay);
     my $filledBackup;
 
     if ( (my @mergeNums = @{$view->mergeNums}) > 1 ) {