[Openmcl-devel] pathname-encoding-name

Pascal J. Bourguignon pjb at informatimago.com
Sun Sep 12 23:46:40 UTC 2010


Gary Byers <gb at clozure.com> writes:

> Something that I read a few years ago suggested that trying to (do the
> equivalent of) set PATHNAME-ENCODING-NAME automatically (from locale
> information) was a bad idea, because that locale information was often
> wrong.  That might be true, but it might be reasonable to do that (and
> suggest that people fix incorrect locale information, which might
> affect other programs as well) rather than require that it be set in
> one's init file (when it's only really needed/used on some platforms.)

Even if the locale is correct, unix file names are but sequences if
binary bytes, and should not be treated otherwise.  

If you choose to represent unix pathnames as strings decoded by ASCII
you will broke because some bytes will be greater than 127.    If you
consider strings decoded from UTF-8-8, you will broke because some
sequences will be wrong.   You consider strings decoded from a 1-1
code such as ISO-8859-1, but then you will have some wrong characters.

IMO, unix path processing functions should use the correct type which
is (vector (unsigned-byte 8)), (which is what a C char[] is), and
relegate conversion to string and dealing with conversion errors, to
the user interface layers.  "Oops, I cannot convert that path to a
string, do you want to see it as an hex dump?"

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/




More information about the Openmcl-devel mailing list