Does this mean that support must be explicitly written for every environment, or is it just Win32 that requires exceptions? | [reply] |
Does this mean that support must be explicitly written for every environment
That depends on what platforms you want to support. There are platforms (and filesystems) that have no provision for multibyte characters in filenames. (For that matter there are platforms that have no provision for filenames, but I don't know that perl runs on any of them.)
Besides Win32, what else do you need to support? Modern POSIX-type systems? OS/2? VMS? Older, pre-POSIX Unix-type systems? Archimedes? Mac System 7? Amiga? PC-DOS 3.3? Whenever you're asking about portability, you've got to give us some hint exactly _HOW_ portable you need to be, i.e., what types of systems you need to support. If you just want to support current major desktop systems (Windows, Mac, the major free Unices, and maybe Solaris) it's one thing; if your portability needs are more extensive, it's another thing.
And with Unicode (unlike most other things), it also makes a big difference
exactly what versions of perl you need to support. If you only have to
support perl 5.8 and higher, that makes a big difference for Unicode.
Sanity? Oh, yeah, I've got all kinds of sanity. In fact, I've developed whole new kinds of sanity. Why, I've got so much sanity it's driving me crazy.
| [reply] |
Thanks for the reply, I think I'm all sorted now. Fortunately the portability bit has been taken care of elsewhere, and the character encoding used by the local file system can be readily established. All that is required is to do:
sub ex {
my $f = shift;
my $enc = "cp1252";
print $f;
Encode::from_to($f, 'utf8', $enc);
print ((-e $f) ? " exists" : " doesn't exist");
print "\n\n";
}
| [reply] [d/l] |