Chris Vine <ch...@cvine.freeserve.co.uk>: > On Tue, 22 Dec 2015 03:14:18 +0200 > Marko Rauhamaa <ma...@pacujo.net> wrote: >> For example, >> >> scheme@(guile-user)> (opendir ".") >> $1 = #<directory stream f7ffa0> >> [...] >> scheme@(guile-user)> (readdir $1) >> $4 = "?9t\x1b[" >> scheme@(guile-user)> (open-file $4 "r") >> ERROR: In procedure open-file: >> ERROR: In procedure open-file: No such file or directory: >> "?9t\x1b[" > > You can set the locale in the REPL, if that is where you are working > from (as in your example), and then UTF-8 pathnames will work fine.
You misunderstood me. The problem is that Guile cannot deal with non-UTF-8 pathnames in a UTF-8 locale. IOW, Linux pathnames are *not* strings. They are bytevectors. Guile 1.x (as well as Python 2.x) was fine bytevector pathnames, but Guile 2.x (as well as Python 3.x) wants to pretend filenames are strings. That leads to trouble, potentially even to security vulnerabilities. A very typical case is a tarball that contains, say, Latin-1 filenames. If you should expand the tarball in a UTF-8 environment, Guile wouldn't be able to deal with the situation. Marko