From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.user Subject: Re: Filename encoding Date: Wed, 15 Jan 2014 16:47:45 -0500 Message-ID: <87iotksyri.fsf@netris.org> References: <20140115125246.53fc72c7@bother.homenet> <87bnzdun74.fsf@netris.org> <20140115195051.3272023c@bother.homenet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1389822650 25415 80.91.229.3 (15 Jan 2014 21:50:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jan 2014 21:50:50 +0000 (UTC) Cc: guile-user@gnu.org To: Chris Vine Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Jan 15 22:50:50 2014 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 1W3YMK-0000yT-8Y for guile-user@m.gmane.org; Wed, 15 Jan 2014 22:50:48 +0100 Original-Received: from localhost ([::1]:57421 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3YMJ-0005OP-Vc for guile-user@m.gmane.org; Wed, 15 Jan 2014 16:50:47 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40589) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3YLn-0005N1-Rb for guile-user@gnu.org; Wed, 15 Jan 2014 16:50:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3YLh-000269-PU for guile-user@gnu.org; Wed, 15 Jan 2014 16:50:15 -0500 Original-Received: from world.peace.net ([96.39.62.75]:50829) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3YLh-000265-Ma for guile-user@gnu.org; Wed, 15 Jan 2014 16:50:09 -0500 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=yeeloong) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1W3YLa-0005Yr-LP; Wed, 15 Jan 2014 16:50:02 -0500 In-Reply-To: <20140115195051.3272023c@bother.homenet> (Chris Vine's message of "Wed, 15 Jan 2014 19:50:51 +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.6.x X-Received-From: 96.39.62.75 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:11021 Archived-At: Chris Vine writes: > POSIX system calls are encoding agnostic. The filename is just a series > of bytes terminating with a NUL character. Yes, I know, but conceptually these things are strings. Unless you're going to treat these filenames as black boxes to be copied from one place to another but never manipulated, printed, or read, you need to know their encoding and you need to treat them as strings internally. > All guile needs to know is what encoding the person creating the > filesystem has adopted in naming files and which it needs to map to. Right, but how does it know that? The closest thing we have to a standard way to tell programs what encoding to use is via the locale. I believe that's what most existing internationalized programs do, anyway. > So far as filenames are concerned, this seems to me to be something > for which a fluid would be just the thing - it could default to the > locale encoding but a user could set it to something else. We could do that, but I'm not really sure how it would improve the situation. If Guile expects the program to know the encoding of filenames on the filesystem, that just passes the buck to the program. How does the program know what encoding to use? Yes, the program can know the encoding if it's a custom program written for one specific system. However, if you write a program that's supposed to work on any system, how do you know the encoding? It seems to me that each system must standardize on a single encoding for all filenames on that system, and the locale encoding is the defacto standard way of telling programs what that is. Regards, Mark