1. Shlomi Fish
  2. LMN

Commits

Shlomi Fish  committed a32a0f9

Properly handle UTF-8 filenames.

  • Participants
  • Parent commits c627e08
  • Branches default

Comments (0)

Files changed (1)

File LMN-File-Manager/lib/App/LMN/FileBrowserWidget.pm

View file
 
 use utf8;
 
+use Encode qw(decode);
+
 use File::Spec;
 use File::stat;
 
     foreach my $filename (@entries)
     {
         my $st = stat( File::Spec->catfile($dir_pathname, $filename) );
-        this->addTopLevelItem(Qt::TreeWidgetItem([$filename, $st->size(), scalar(localtime($st->mtime()))], Qt::TreeWidgetItem::Type()));
+        this->addTopLevelItem(
+            Qt::TreeWidgetItem(
+                [
+                    decode('UTF-8', $filename),
+                    $st->size(),
+                    scalar(localtime($st->mtime()))
+                ],
+                Qt::TreeWidgetItem::Type()
+            )
+        );
     }
 
     return;