[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running script from directory with UTF-8 characters

From: Marko Rauhamaa
Subject: Re: Running script from directory with UTF-8 characters
Date: Tue, 22 Dec 2015 17:55:58 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Chris Vine <address@hidden>:

> On Tue, 22 Dec 2015 03:14:18 +0200
> Marko Rauhamaa <address@hidden> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]