guix-devel
[Top][All Lists]
Advanced

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

Re: How to deal with Latin1 filenames?


From: Ludovic Courtès
Subject: Re: How to deal with Latin1 filenames?
Date: Mon, 05 Dec 2016 22:07:29 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux)

Marius Bakke <address@hidden> skribis:

> Marius Bakke <address@hidden> writes:
>
>> Hello Guix,
>>
>> I'm trying to package the Norwegian Bokmål Aspell dictionary, which
>> contains a 'bokmål.alias' in the source archive. This causes 'readdir'
>> 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: ‘gnu-build-system’ 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’ll have to add a package containing that locale as an input
to the build process though.

To that end, I suggest that you abstract ‘glibc-utf8-locales’ in
base.scm so you can then write:

  (define glibc-latin1-locales
    (make-glibc-locale-package "ISO-8859-1" '("nb_NO" "fr_FR")))

That’s more than you wanted to know I guess.  Don’t expect to
spell-check your Norwegian text for the time being.  ;-)

HTH!

Ludo’.



reply via email to

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