In my code I solve a problem like this (this is in 5.6.1 time, now
use Unicode is somewhat obsolete):
use Win32::OLE qw(in CP_UTF8);
use Win32::OLE::Const;
Win32::OLE->Option(CP=>CP_UTF8);
use Unicode::String qw/utf8/;
my $oshell = Win32::OLE->new('Shell.Application') or die "$@";
my $f = $oshell->NameSpace(Win32::GetCwd());
print "[$f]";
my $fi = $f->Items;
print $fi->Count;
print "\n";
for (0 .. $fi->Count-1) {
my $item = $fi->Item($_);
my $name = $item->Name;
my $u=utf8($name);
my $s = $u->hex;
$s=~s/U\+00(\w\w)/my($r,$p)=((pack 'H*',$1),$&);if($r=~m(^[()\w .;\-
++!]$)){$r}else{$p}/eg;
$s=~s/(U\+[\da-f][\da-f][\da-f][\da-f])/($1)/ig;
my $ren=0;
$ren=1 if $s=~/U\+(?!00)/;
$s=~s/[ +]//g;
print "$ren|$s\n";
if($ren){$item->{Name}=$s}
}
Best regards,
Courage, the Cowardly Dog
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.