Hi,
I am writing a perl script that loops over my directories on a Windows XP system, and some of the directories have non-ascii filenames (accented letters and some Japanese text).
This seems to break many things in perl, and I was wondering if there were any workarounds.
One problem I am having is just traversing directories. When I do an opendir / readdir, I cannot "chdir" to the value that is returned. For example, readdir will return a string of non-ascii characters for a Japanese directory, but this string of characters is not accepted by chdir.
I have done a lot of research of this on the web, and from what I have figured out, the system calls that perl is using is trying to do some sort of translation on the characters.
Is there any way to make the system not do any translation? I have tried changing my default "language" for non-unicode programs, and it does change the results, but just ends up with a different set of "broken directories".
Anything that would allow the value returned by "readdir" to be passed into "chdir" for all types of filenames would make me very happy.
Some of what I read on the internet talks about older versions of perl supporting a "-c" option that kind of did what I am looking for. Would tracking down and downloading an old version fix my problem?
Thanks,
Ron Miller
p.s. Fixing readdir / chdir would fix most of my problems, but it would also be nice if I could open files with non-ascii filenames, and use "rename" as well.
I am writing a perl script that loops over my directories on a Windows XP system, and some of the directories have non-ascii filenames (accented letters and some Japanese text).
This seems to break many things in perl, and I was wondering if there were any workarounds.
One problem I am having is just traversing directories. When I do an opendir / readdir, I cannot "chdir" to the value that is returned. For example, readdir will return a string of non-ascii characters for a Japanese directory, but this string of characters is not accepted by chdir.
I have done a lot of research of this on the web, and from what I have figured out, the system calls that perl is using is trying to do some sort of translation on the characters.
Is there any way to make the system not do any translation? I have tried changing my default "language" for non-unicode programs, and it does change the results, but just ends up with a different set of "broken directories".
Anything that would allow the value returned by "readdir" to be passed into "chdir" for all types of filenames would make me very happy.
Some of what I read on the internet talks about older versions of perl supporting a "-c" option that kind of did what I am looking for. Would tracking down and downloading an old version fix my problem?
Thanks,
Ron Miller
p.s. Fixing readdir / chdir would fix most of my problems, but it would also be nice if I could open files with non-ascii filenames, and use "rename" as well.