ActiveState decided it was better to use the ANSI APIs for files. However, the Unicode version still exists, they just disabled respecting that flag. Recompile yourself and you can use file names in all their glory. I had to do that to make a backup program keep working after I got a new version from AS.

The File API's in Windows don't even use the ANSI code page (e.g. Latin-1). They use the "OEM" code page, like DOS did. So some characters encode differently. The '£' in Windows 1252 A3 (and this is different from ISO 8859-1). That byte in Code Page 437 is the LATIN SMALL LETTER U WITH ACUTE, "ú". So Perl converts the internal string to code page 1252 (if it was of the Unicode persuasion) and codes an A3 byte where you put '£'. Then it calls the Windows API function ending with -A, which is taking its argument in code page 437, and thinks the A3 byte is a 'ú', which it converts into UTF-16LE (U+00FA) to pass to the -W version of that function, which is unambiguously Unicode and is certain you meant 'ú'.

You can also call a Windows function SetFileApisToANSI, using the Win32 module to call the Kernel32 DLL, and see if that helps. At least it removes this layer of obfuscation.

—John


In reply to Re: opening files with tk getOpenFile by John M. Dlugosz
in thread opening files with tk getOpenFile by skywalker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.