On 2025-01-13 16:45, Johan Vromans wrote:
A question for Windows experts.
I have installed a wxPerl application and associated it with files with
extension '.cho'.
When I doubleclick in the Explorer on such a file, my program is started
and gets the name of the file passed via @ARGV. Well, more or less...
I have a folder (on an NTFS filesystem) with three files:
asciiname.cho
namewitháccent.cho
namewith♡unicode.cho
From within the program, I can open the file if I dclick the first and the
second name, but not the third name.
What **exactly** is passed in @ARGV when I dclick these files?
Since the filesystem is NTFS, I would expect a filename in UTF-16LE but
when I dump the content of @ARGV (using charnames to avoid encoding issues)
I get
"asciiname.cho" -- apparently ASCII
"namewith\N{LATIN SMALL LETTER WITH ACUTE}ccent.cho" -- apparently UTF8
"namewith?unicode.cho" -- ????
Anyone have an idea what I'm doing wrong?
I think you have to decode the file names.
use Encode qw(decode);
my $file = decode($ARGV[0]);
--
𝑆𝒉𝒂𝒘𝒏 𝐻 𝐶𝒐𝒓𝒆𝒚 🇨🇦