Skip Menu |

This queue is for tickets about the File-Find-Object CPAN distribution.

Report information
The Basics
Id: 93517
Status: resolved
Priority: 0/
Queue: File-Find-Object

People
Owner: Nobody in particular
Requestors: meir [...] guttman.co.il
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Support for Unicode file names
Date: Tue, 04 Mar 2014 16:22:00 +0200
To: bug-File-Find-Object [...] rt.cpan.org, 'Shlomi Fish' <shlomif [...] shlomifish.org>
From: Meir Guttman <meir [...] guttman.co.il>
Dear Shlomi, Your very useful File::Find::Object package does injustice to file systems that support Unicode file names, e.g. Hebrew names in Windows NTFS. When encountering such a filename it resorts to its 8.3 DOS equivalent. Do I miss something? Meir Guttman meir@guttman.co.il
Hi Meir, thanks for the report, see below for my response. On Tue Mar 04 09:22:13 2014, meir@guttman.co.il wrote: Show quoted text
> Dear Shlomi, > Your very useful File::Find::Object package does injustice to file systems > that support Unicode file names, e.g. Hebrew names in Windows NTFS. > When encountering such a filename it resorts to its 8.3 DOS equivalent. > Do I miss something? > Meir Guttman > meir@guttman.co.il > >
This is just a note that on Mageia Linux x86-64 Cauldron (and most probably other versions of GNU/Linux and likely other UNIXes), everything is working fine: [SHELL] shlomif@telaviv1:~$ cat F-F-O.pl #!/usr/bin/perl use strict; use warnings; use File::Find::Object; my $dir_path = shift(@ARGV); my $tree = File::Find::Object->new({}, $dir_path); while (my $r = $tree->next()) { print $r ."\n"; } shlomif@telaviv1:~$ perl F-F-O.pl /home/music/Music/mp3s/ | grep -E 'הדס מושל|é'/home/music/Music/mp3s/Beyoncé - Best Thing I Never Had-FHp2KgyQUFk.webm /home/music/Music/mp3s/Emeli Sandé - Next To Me--nwdjQmc_N8.mp4 /home/music/Music/mp3s/Jhené Aiko - 3:16am-0pWgLPOgwNc.webm /home/music/Music/mp3s/Montse Cortés La Noche-OGTtvgQOEMI.webm /home/music/Music/mp3s/Tributo a De André - Volta la carta - Le Balentes-glOFS5o5PJc.flv /home/music/Music/mp3s/יויה - הדס מושל - ג'אם המחנה 3-eMQXbCV6Vxw.webm /home/music/Music/mp3s/מפנה מקום - הדס מושל - ג'אם המחנה 4-H2QXfNM6z8I.webm [/SHELL] Which distribution of Perl are you using (Strawberry Perl, ActivePerl, etc.)? Which version of this distribution? Which Windows version is it? Which processor architecture (x86-64, i586)? Can you provide a sample offending tree in an archive? I guess I can try it on a Windows VM or check "perldoc perlport." But it seems like an issue of Perl in combination with Windows. Regards, -- Shlomi Fish
On Tue Mar 04 09:22:13 2014, meir@guttman.co.il wrote: Show quoted text
> Dear Shlomi, > Your very useful File::Find::Object package does injustice to file systems > that support Unicode file names, e.g. Hebrew names in Windows NTFS. > When encountering such a filename it resorts to its 8.3 DOS equivalent. > Do I miss something? > Meir Guttman > meir@guttman.co.il > >
Hi Meir, in addition, these links may prove of insight: * http://stackoverflow.com/questions/770171/how-do-i-get-full-win32-path-from-8-3-dos-path-with-perl * http://www.perlmonks.org/?node_id=811723 Regards, -- Shlomi Fish
Subject: RE: [rt.cpan.org #93517] Support for Unicode file names
Date: Tue, 04 Mar 2014 19:20:58 +0200
To: bug-File-Find-Object [...] rt.cpan.org
From: Meir Guttman <meir [...] guttman.co.il>
Thank you Shlomi, Here is my environment: * Perl: Strawberry Perl v.5.18.2 x64 bit * OS: Win-7 Pro 64-bit Service Pack 1 Build 7601 * Architecture: x64-based PC * File::Find::Object details: C:\strawberry\perl\site\lib\File\Find\Object.pm Installed: 0.2.9 CPAN: v0.2.9 up to date Shlomi Fish (SHLOMIF) shlomif@shlomifish.org And I think that my Perl distribution doesn't deal well with Unicode/utf8 statements. For example, the following lines: my $start_dir = "D:/Meir/Dropbox/About/לשון עברית"; chdir "$start_dir" or die "Can't cd to $start_dir: $!\n"; dies with: Can't cd to D:/Meir/Dropbox/About/╫£╫⌐╫ò╫ƒ ╫ó╫æ╫¿╫Ö╫¬: No such file or directory (the garbage characters are due to the 'cmd' windows lack of Unicode support. I would like to note that the above is despite having: use utf8; binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); in my code! And of course, the directory "לשון עברית" is there! I am attaching a directory with Hebrew named files among others. And regarding your other mail, how can I use Win32::GetLongPathName(PATHNAME) in the context of File::Find::Object? Regards, Meir
Download Recreational.zip
application/x-zip-compressed 109.7k

Message body not shown because it is not plain text.

Hi Meir, On Tue Mar 04 12:21:15 2014, meir@guttman.co.il wrote: Show quoted text
> Thank you Shlomi, > > Here is my environment: > * Perl: Strawberry Perl v.5.18.2 x64 bit > * OS: Win-7 Pro 64-bit Service Pack 1 Build 7601 > * Architecture: x64-based PC > * File::Find::Object details: > C:\strawberry\perl\site\lib\File\Find\Object.pm > Installed: 0.2.9 > CPAN: v0.2.9 up to date > Shlomi Fish (SHLOMIF) > shlomif@shlomifish.org >
OK, thanks for the info. Show quoted text
> And I think that my Perl distribution doesn't deal well with > Unicode/utf8 statements. For example, the following lines: > my $start_dir = "D:/Meir/Dropbox/About/לשון עברית"; > chdir "$start_dir" or die "Can't cd to $start_dir: $!\n"; > > dies with: > Can't cd to D:/Meir/Dropbox/About/╫£╫⌐╫ò╫ƒ ╫ó╫æ╫¿╫Ö╫¬: No such > file or directory > (the garbage characters are due to the 'cmd' windows lack of Unicode > support. > > I would like to note that the above is despite having: > use utf8; > binmode(STDOUT, ":utf8"); > binmode(STDERR, ":utf8"); > in my code! > And of course, the directory "לשון עברית" is there! > I am attaching a directory with Hebrew named files among others. > > And regarding your other mail, how can I use > Win32::GetLongPathName(PATHNAME) in the context of File::Find::Object?
I think you do something like: my $result_short = $ffo->next(); my $result_long = Win32::GetLongPathName($result_short); And then look at $result_long. Regards, -- Shlomi Fish Show quoted text
> > Regards, > Meir
Subject: RE: [rt.cpan.org #93517] Support for Unicode file names
Date: Tue, 04 Mar 2014 19:38:57 +0200
To: bug-File-Find-Object [...] rt.cpan.org
From: Meir Guttman <meir [...] guttman.co.il>
Thank you Shlomi, Here is my environment: * Perl: Strawberry Perl v.5.18.2 x64 bit * OS: Win-7 Pro 64-bit Service Pack 1 Build 7601 * Architecture: x64-based PC * File::Find::Object details: C:\strawberry\perl\site\lib\File\Find\Object.pm Installed: 0.2.9 CPAN: v0.2.9 up to date Shlomi Fish (SHLOMIF) shlomif@shlomifish.org And I think that my Perl distribution doesn't deal well with Unicode/utf8 statements. For example, the following lines: my $start_dir = "D:/Meir/Dropbox/About/לשון עברית"; chdir "$start_dir" or die "Can't cd to $start_dir: $!\n"; dies with: Can't cd to D:/Meir/Dropbox/About/╫£╫⌐╫ò╫ƒ ╫ó╫æ╫¿╫Ö╫¬: No such file or directory (the garbage characters are due to the 'cmd' windows lack of Unicode support. I would like to note that the above is despite having: use utf8; binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); in my code! And of course, the directory "לשון עברית" is there! I am attaching a directory with Hebrew named files among others. ============== Addition =============== And regarding your other mail, how can I use Win32::GetLongPathName(PATHNAME) in the context of File::Find::Object? I figured it out! while (my $file_name = $tree->next()) { my $long_name = Win32::GetLongPathName($file_name); my ($name,$path,$ext) = fileparse($long_name, qr/\.[^.]*/); print "$long_name\n"; } ======================================= Regards, Meir
Download Recreational.zip
application/x-zip-compressed 109.7k

Message body not shown because it is not plain text.

Hi, Reading from #win32 on irc.perl.org: <rindolf> Hi all. https://rt.cpan.org/Public/Bug/Display.html?id=93517 - File::Find::Object reportedly resorts to displaying filenames with Unicode characters using their 8.3 equivalent filenames on Win32/Win64. It's fine on Linux. Is it a known problem? <dipsy> [ Bug #93517 for File-Find-Object: Support for Unicode file names ] <leont> rindolf: Unicode filenames on Windows is a known issue <rindolf> leont: OK, thanks. <rindolf> leont: should I close that bug? <leont> Maybe, don't have time to look at it now <leont> I just grok where it would come from, and it's a core bug really So it's a Windows-specific problem - possibly with the perl core. Next time, please check whether such problems are Windows-specific or not. Regards, -- Shlomi Fish