Win32::Shortcut works for ASCII file names only

[email protected] (Cacadril)
Newsgroups perl.libwin32
Organization http://groups.google.com
Message-ID <[email protected]>
I retrieve path names using the File::Find module, and "windowsify"
the paths by changing

/cygdrive/f   --> F:   and  / --> \\

globally.  What more do I have to do to make it work?

My actual code was similar to this:
#!/usr/bin/perl -w
use File::Find;
use Win32::Shortcut;
sub wanted {
  return unless /\.lnk$/i;
  my $winname = $File::Find::name;
  $winname =~ s{^/cygdrive/f/}{F:\\};
  $winname =~ s{/}{\\}g;
  my $LINK = new File::Find::Shortcut($winname)
    or do{warn "Could not find '$winname'.\n"; return};
  $LINK->{'Path'} =~ s{^C:\\Documents and settings\\blah\\My Pictures\
\}{F:\\Blah Pictures\\}
    and $LINK->Save();
}
File::Find::find(\&wanted, "/cygdrive/f");

The script fixes shortcuts after moving a folder hierarchy to a new
drive. It works for shortcuts having ascii-only names.

I suspect the problem is related to this call in the module source
file Shortcut.xs:498:
MultiByteToWideChar(CP_ACP, 0, filename, -1, (wchar_t *)wfilename,
MAX_PATH);

I suspect that CP_ACP, the "ansi" codepage, mangles 8-bit codes
somehow.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.