[Israel.pm] Perl and Unicode file names

Peter Gordon peter at pg-consultants.com
Thu Feb 24 04:52:44 PST 2005


I am using ActiveState Perl 5.008.006 on XP

On Thu, 2005-02-24 at 14:27 +0200, Shlomi Fish wrote:
> On Thursday 24 February 2005 13:11, Peter Gordon wrote:
> > Hi Guys.
> >
> > I need some help with a project that I have. I have to copy files using
> > Perl to different places and the filenames may be in Hebrew, Chinese,
> > Korean etc.
> >
> > The problem is, that filenames, when using opendir, are returned as
> > question marks. In the DOS box I have set the codepage to 862. So DIR
> > returns accented characters, but Perl still returns question marks. I
> > have also set "use utf8", but that didn't help either.
> >
> 
> Works for me. The following program:
> 
> <<<
> opendir D, "/dosd/Music/mp3/"; 
> my @files = readdir(D); 
> closedir(D); 
> open O, ">dump.txt"; 
> print O (map { "$_\n" } @files); 
> close(O);
> >>>
> 
> Prints the Hebrew filenames with their accents. My locale is en_US/en_AU. 
> (non-Unicode). I'm using perl-5.8.5 on Mandrake Linux 10.1.
> 
> It would be more helpful if you said what Perl version and operating system 
> you're using and what is your locale.
> 
> Regards,
> 
> 	Shlomi Fish
> 
> ---------------------------------------------------------------------
> Shlomi Fish      shlomif at iglu.org.il
> Homepage:        http://www.shlomifish.org/
> 
> Knuth is not God! It took him two days to build the Roman Empire.
> _______________________________________________
> Perl mailing list
> Perl at perl.org.il
> http://perl.org.il/mailman/listinfo/perl
> 
> 
-- 
Peter Gordon
Phone: +972 544 438029
Email: peter at pg-consultants.com
Web: www.pg-consultants.com




More information about the Perl mailing list