+ James Y Knight <foom@...>:
| The hard part is that users expect command line arguments,
| filenames, and environment values to be strings (because they
| normally do contain text-like things), when strictly they cannot be
| because there is no reliable encoding.
Indeed. So one could argue that the program arguments and environment
should really be kept as byte strings throughout, and one should leave
the task of converting to and from strings using whatever encoding
they wish to the user. I think users who mostly wish to deal with
strings will not be happy with that. As an alternative, one could let
RUN-PROGRAM accept a mixture of (character) strings and byte strings
in the args and environment, use the latter as delivered, and convert
the former. That way we can have our cake and eat it too. But then,
for reasons of symmetry, we should also provide low level access to
the environment, so users can grab any binary junk in there and do
useful things with it.
While all this might be useful, I am not sure I feel inclined to do
it, though. After all, the environment and program args are
traditionally text, not binary junk, and I believe that posix doesn't
even admit non-ASCII data in the environment. Not that we would want
to enforce that; users may wish to have their full name in an
environment variable for example.