
On Wed, Nov 20, 2013 at 6:03 PM, Ashley Yakeley
In unix-2.7.0.0, fdRead and fdWrite in System.Posix.IO.ByteString use String instead of ByteString. This is wrong, isn't it? The point of the .ByteString modules is to do IO in ByteString.
No. ByteString provides its own routines for that. The point of System.Posix.IO.ByteString is to provide a ByteString (which is to say, a correct POSIX) interface to *filesystem paths*. Using String for these is entirely incorrect, because POSIX pathnames are literally byte strings --- there is no encoding, just raw bytes with only '/' and '\NUL' being special. There are *lots* of programs that behave weirdly or crash because they assume the filesystem uses normalized UTF8, but absolutely nothing forces pathnames to be UTF8 much less normalized UTF8. (Gtk+ file dialogs tend to crash with non-UTF8-encoded filenames. They do even weirder things when filenames are UTF8 but not normalized. OS X native file dialogs have similar problems.) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net