perl-unicode

Re: perlunicode comment - when Unicode does not happen

2003-12-22 15:30:09

"Jarkko Hietaniemi" <jhi(_at_)iki(_dot_)fi> wrote in message
news:A1D5AFFC-34BC-11D8-A034-00039362CB92(_at_)iki(_dot_)fi(_dot_)(_dot_)(_dot_)
*Which* multibyte?

This is the key point. The answer on a Unix-like system is "the one you get
when you do wctomb()". And that routine knows what to do by virtue of
setlocale() (or the default if setlocale is never called). Who knows how the
file system stores the file name - it isn't important. But that's the way
you interact with it. There may be Unix-style file systems out there that
work differently - please tell me which one.

I tend to misbelieve that :-)  All "-d" is doing is passing the $newdir
(UTF-8) bytes to stat(2).

Believe! win32.c:

    if (l > 1) {
 switch(path[l - 1]) {
 /* FindFirstFile() and stat() are buggy with a trailing
  * backslash, so change it to a forward slash :-( */
 case '\\':
     strncpy(buffer, path, l-1);
     buffer[l - 1] = '/';

That isn't the only piece of Perl code that plays "flip the backslashes" or
chops a final backslash - and all that code breaks Shift-JIS characters with
0x5C as a second byte.

Regards,

=ED