Hello esteemed monks, I am having trouble using wide characters in filenames on Windows 10 using File::Copy. The wide characters appear just fine if I write them to a text file, and I can manually copy/paste them into filenames in Windows Explorer, but if I use File::Copy they come out all wonky.
use File::Copy;
my $oldname = "file.txt";
my $newname = "Hildur_Guðnadóttir.txt";
copy(oldname, $newname);
This file name comes out looking like so:
Hildur_Guðnadóttir.txt
Yet if I open a file and write $newname to it, it displays just fine.
Any way to do this correctly with (or without) File::Copy ?
Thanks, Scott
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.