I think that current locale settings (locale(7)) should be used as default value.
Software on Unix like systems, at least Linux, tends to use utf-8 for encoding of filenames nowadays, but there's no global enforcement for this. The kernel and libc treat paths just as byte strings. I guess OS X has some enforcement law to make everything use utf-8. Windows afaik stores the used encoding in the filesystem, which should make it more clear which encoding to assume (and might even do the transcoding for you, not sure).
I think you can't really assume locale settings for changing this behaviour; if you do, you're fine as long as you don't change the locale for the lifetime of a particular filesystem. Since you're inevitable also going to deal with filesystems written with different encoding assumptions sometimes.
Probably there's no other way to deal with it than the same way you deal with textual file ports: specify the encoding when opening the port. Meaning, give the encoding when calling |open-directory|. Maybe have another Gambit startup flag to set the default. (Gambit doesn't check the locale for file ports, why should it use the locale for directory ports?)
(One could argue that if the encoding is unknown, input/output procedures should return u8vector's instead of strings, and accept u8vectors instead of strings.)
Christian.
(This is my first mail to a mailing list sent from Gmail, going to see whether lines are too long. If they are, what are other Gmail users doing about it?)
Afficher les réponses par date
2009/9/8 Christian Jaeger chrjae@gmail.com:
(This is my first mail to a mailing list sent from Gmail, going to see whether lines are too long. If they are, what are other Gmail users doing about it?)
Hi Christian
For some reason, your mail has a font different from anyone else's emails. Can you be sure to send emails as text, instead of HTML ?
Besides that, I think that using the current locale is the best default. If none is set, then choose UTF-8.
I'm thinking that, while my term is ran with some locale settings, my crontab is not. So, whatever decision you choose, it deserves a nice entry in the documentation so that people don't get puzzled when their programs stop working when put into a crontab.
Cheers,
P!