From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: How to deal with Latin1 filenames? Date: Mon, 05 Dec 2016 22:07:29 +0100 Message-ID: <87bmwqytim.fsf@gnu.org> References: <8760mzbh9k.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> <87wpfen6tb.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54102) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cE0U4-0007CY-UU for guix-devel@gnu.org; Mon, 05 Dec 2016 16:07:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cE0U0-0007GH-1K for guix-devel@gnu.org; Mon, 05 Dec 2016 16:07:36 -0500 In-Reply-To: <87wpfen6tb.fsf@kirby.i-did-not-set--mail-host-address--so-tickle-me> (Marius Bakke's message of "Mon, 05 Dec 2016 09:01:04 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Marius Bakke Cc: guix-devel@gnu.org Marius Bakke skribis: > Marius Bakke writes: > >> Hello Guix, >> >> I'm trying to package the Norwegian Bokm=C3=A5l Aspell dictionary, which >> contains a 'bokm=C3=A5l.alias' in the source archive. This causes 'readd= ir' >> to throw a decoding-error. > > I'm sorry, the file name is actually ISO-8859-1 encoded. I've updated > the subject. From what I understand Guile should be able to handle > unicode file names just fine. In Guile, file names are strings and not bytevectors like in C. So they have to be properly encoded. The convention that Guile follows is to decode file names according to its current locale encoding. By default, all our builds run in the en_US.utf8 locale. However, you can change that: =E2=80=98gnu-build-system=E2=80=99 supports a= #:locale parameter, so you can do: #:locale "nb_NO.iso88591" > Are there any Latin1 locales available in the build environment, and > would setting it make any difference? No! So you=E2=80=99ll have to add a package containing that locale as an i= nput to the build process though. To that end, I suggest that you abstract =E2=80=98glibc-utf8-locales=E2=80= =99 in base.scm so you can then write: (define glibc-latin1-locales (make-glibc-locale-package "ISO-8859-1" '("nb_NO" "fr_FR"))) That=E2=80=99s more than you wanted to know I guess. Don=E2=80=99t expect = to spell-check your Norwegian text for the time being. ;-) HTH! Ludo=E2=80=99.