unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Marius Bakke <mbakke@fastmail.com>
Cc: guix-devel@gnu.org
Subject: Re: How to deal with Latin1 filenames?
Date: Mon, 05 Dec 2016 22:07:29 +0100	[thread overview]
Message-ID: <87bmwqytim.fsf@gnu.org> (raw)
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")

Marius Bakke <mbakke@fastmail.com> skribis:

> Marius Bakke <mbakke@fastmail.com> 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	other threads:[~2016-12-05 21:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-04 19:56 How to deal with UTF-8 filenames? Marius Bakke
2016-12-05  8:01 ` How to deal with Latin1 filenames? Marius Bakke
2016-12-05 21:07   ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bmwqytim.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=mbakke@fastmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).