Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
dear monks,
I'm trying to figure out if I can handle Unicode filenames on Windows using Perl 5.8.7 for MSWin32-x86-multi-thread , and if so, how.

I'm running on Windows 2000 (English language setup), and I have a directory full of files with all sorts of characters in their names. Windows Explorer displays them all very nicely.
in this link i have given the screen shots shown in windows explorer

http://www.mhonarc.org/archive/html/perl-unicode/2004-06/pngH6uiVrjVZ0.png

But when I use readdir() to list them, I find that each of the chinese characters get replaced with a "?", so then, of course, I can't do anything with the filenames returned (like open them).
the results for my program is shown in this link

http://www.mhonarc.org/archive/html/perl-unicode/2004-06/pngxn9h5I2BLD.png

So my question is: How can I deal with these files?
I've tried using Perl scalars containing UTF-8, UTF-16LE and UTF-16BE encodings of the filenames, but none of them work either. Indeed, if I try to write a new file with a name constructed in those ways, then the name of the file actually created is simply the sequence of bytes that make up those encodings.

In reply to how to read unicode filename by uva

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (2)
As of 2024-04-26 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found