unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tomas Volf <~@wolfsden.cz>
To: guix-devel@gnu.org
Subject: How to write a compute-file producing utf8 output?
Date: Thu, 23 May 2024 18:17:40 +0200	[thread overview]
Message-ID: <Zk9sJPSeXhYsmuTE@ws> (raw)

[-- Attachment #1: Type: text/plain, Size: 968 bytes --]

Hello Guix,

I am currently struggling when trying to create a computed-file producing
internationalized content.  Simple reproducer is:

      (use-modules (gnu packages base)
                   (guix gexp))

      (computed-file
       "utf8-display"
       #~(with-output-to-file #$output
           (λ ()
             (display "猫\n"))))

This, when executed and printed, gives following result:

      /tmp $ guix build -e '(load "/tmp/yy.scm")'
      /gnu/store/fyr9h82v9hhbjm4f7lqsdnhs4c45sn3y-utf8-display
      /tmp $ cat /gnu/store/fyr9h82v9hhbjm4f7lqsdnhs4c45sn3y-utf8-display
      ?

As you can see, ? does not equal 猫.  I would expect the root cause to be the
same as #66777.

Any ideas what can I do about this?  Or, even better, why this does not just
work out of the box?

Thanks for your help,
Tomas

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2024-05-23 16:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-23 16:17 Tomas Volf [this message]
2024-05-23 19:59 ` How to write a compute-file producing utf8 output? Felix Lechner via Development of GNU Guix and the GNU System distribution.
2024-06-01 13:39 ` Ludovic Courtès
2024-06-01 13:47   ` Tomas Volf

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=Zk9sJPSeXhYsmuTE@ws \
    --to=~@wolfsden.cz \
    --cc=guix-devel@gnu.org \
    /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).