in reply to Re: Opening files with japanese/chinese chars in filename
in thread Opening files with japanese/chinese chars in filename

Thanks for your tip, was searching the same question online and find this page.
To the above code, I get $file->Move work with CJK filename, the problem I have here is if $path is a path contain utf8 $folder = $obj->GetFolder($path);
does not seems to work, while if it is in Big5 it works then...

Any suggestion? Thanks!
  • Comment on Re^2: Opening files with japanese/chinese chars in filename

Replies are listed 'Best First'.
Re^3: Opening files with japanese/chinese chars in filename
by nikosv (Deacon) on Apr 23, 2008 at 18:09 UTC

    Can you be more specific? Maybe provide a code sample and point out where the actual problem is?

    Try the following script which just gets all subdirectories and prints their name out.
    Does it work for the directory in question?

    use Win32::OLE qw(in); Win32::OLE->Option(CP => Win32::OLE::CP_UTF8); $obj = Win32::OLE->new('Scripting.FileSystemObject'); $folder = $obj->GetFolder("."); $collection= $folder->{SubFolders}; foreach $value (in $collection) { $foldername= %$value->{Name}; $folder=$obj->GetFolder("$foldername"); print (Win32::FormatMessage(Win32::OLE->LastError())|| "$foldernam +e"); }