From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marko Rauhamaa Newsgroups: gmane.lisp.guile.user Subject: Re: Running script from directory with UTF-8 characters Date: Tue, 22 Dec 2015 03:14:18 +0200 Message-ID: <87io3rffo5.fsf@elektro.pacujo.net> References: <87twnbfkzb.fsf@elektro.pacujo.net> <20151222003447.198ea945@bother.homenet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1450746872 20208 80.91.229.3 (22 Dec 2015 01:14:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 22 Dec 2015 01:14:32 +0000 (UTC) Cc: guile-user@gnu.org To: Chris Vine Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Dec 22 02:14:32 2015 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aBBX6-0006Ur-2c for guile-user@m.gmane.org; Tue, 22 Dec 2015 02:14:32 +0100 Original-Received: from localhost ([::1]:48124 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBBX5-0001EX-1L for guile-user@m.gmane.org; Mon, 21 Dec 2015 20:14:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51626) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBBWv-0001EI-Qu for guile-user@gnu.org; Mon, 21 Dec 2015 20:14:22 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBBWu-0002Tk-UV for guile-user@gnu.org; Mon, 21 Dec 2015 20:14:21 -0500 Original-Received: from [2001:1bc8:1a0:5384:7a2b:cbff:fe9f:e508] (port=38638 helo=pacujo.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBBWu-0002Tg-Mr for guile-user@gnu.org; Mon, 21 Dec 2015 20:14:20 -0500 Original-Received: from elektro.pacujo.net (192.168.1.200) by elektro.pacujo.net; Tue, 22 Dec 2015 03:14:18 +0200 Original-Received: by elektro.pacujo.net (sSMTP sendmail emulation); Tue, 22 Dec 2015 03:14:18 +0200 In-Reply-To: <20151222003447.198ea945@bother.homenet> (Chris Vine's message of "Tue, 22 Dec 2015 00:34:47 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:1bc8:1a0:5384:7a2b:cbff:fe9f:e508 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12261 Archived-At: Chris Vine : > I think the problem is that calling the native 'primitive-load' > procedure on a filename with UTF-8 encoding with a character outside > the ASCII range (when the locale encoding is also UTF-8) fails to work > unless you call '(set-locale LC_ALL "")' in the program first. > > Of course you can't do that when passing guile a filename as a program > argument. It does seem like a weakness, even if not a bug. How can it not be a bug? Also, Linux pathnames can contain any bytes other than NUL regardless of the locale (and quite often do) so I hope Guile doesn't paint itself too deep in the Unicode corner. Python is struggling with analogous issues but has been careful to at least make it possible to deal with bytevector pathnames and bytevector standard ports. For example, scheme@(guile-user)> (opendir ".") $1 = # [...] 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[" Marko