Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Renaming non-ascii files

by Anonymous Monk
on Jun 03, 2005 at 11:47 UTC ( #463227=note: print w/replies, xml ) Need Help??


in reply to Re: Renaming non-ascii files
in thread Renaming non-ascii files

I see where you are going, but it will not work.

The reason I did not use:

m/[^:ascii:]]/
is Perl does not see the non-ascii characters at all. It sees only question marks for filenames. Even though in Windows the filenames appear in a native lanuage like Japanese or Arabic. Example: ??? ?? ???.txt is what Perl sees as a non-ascii filename. Therefore, I picked up non-ascii files using:
m/[\?]+/
and it worked...sometimes. The reason it does not work all the time is that if a file has exactly the same number of question marks perl considers it a duplicate and will not rename it.

I need a method to make Perl, when reading a directory or globbing(i've tried globbing many of times, no go) to see these filenames as they are, not as question marks.

thank for your assistance

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://463227]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2023-05-30 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?