in reply to Re: Handling windoze filenames with odd charactters
in thread Handling windoze filenames with odd charactters

I would be very surprised if stat or rename has problems with files that contain odd characters.

odd characters (ie unicode) is simply not supported. Win32::Unicode Re: Is File::Find Unicode-(Conformant|Compliant|Enabled|Capable)?

  • Comment on Re^2: Handling windoze filenames with odd charactters

Replies are listed 'Best First'.
Re^3: Handling windoze filenames with odd charactters
by chrestomanci (Priest) on Feb 21, 2011 at 10:41 UTC

    OK. Colour me supprised.

    When I wrote that I would be surprised if stat or rename had problems with files that contain odd characters, I was actualy thinking of characters is the ASCII character set, not Unicode, howerver, I am suprised and disapointed that perl cannot transparently handle unicode in filenames.

    Perl has for many years transparently handled unicode in string varables. There are of course many pitfalls in constructing those strings from data external to the script, but in this case that should not be the programer's problem. Perl's readdir should just make the appropare Windows System calls to get the unicode filename, and store that filename, complete with any unicode in an internal string.

    The programer should then be able to read and write to files with those names without worring if they contain unicode or not. Obvously if the programer is transforming filenames they they need to be carefull, but in many cases that is not an issue. It is far more common to open and read a file than it is to rename one.

    I think that it is a mistake in 2011 for perl to deleberately use the old Win9x API to get an ASCII filename for backwards compatibility reasons, when the last Win9x OS was retired many years ago.