guix-devel
[Top][All Lists]
Advanced

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

Re: How to write a compute-file producing utf8 output?


From: Felix Lechner
Subject: Re: How to write a compute-file producing utf8 output?
Date: Thu, 23 May 2024 12:59:18 -0700

Hi Tomas,

On Thu, May 23 2024, Tomas Volf wrote:

> As you can see, ? does not equal 猫.

Maybe it helps you that this file works:

    (use-modules (gnu packages base)
                 (guix gexp))
    
    (computed-file
     "utf8-display"
     #~(with-output-to-file #$output
         (λ ()
           (use-modules (ice-9 binary-ports)
                        (rnrs bytevectors))
           (put-bytevector (current-output-port)
                           (string->utf8 "猫\n")))))

Diagnosing encoding issues can be tricky.  Therefore:

    $ guix shell xxd -- xxd 
/gnu/store/qqljfpzks62kph7qqdv26aj76r2q14nz-utf8-display
    00000000: e78c ab0a

The present issue reminds me---and perhaps you---of
https://issues.guix.gnu.org/69381.

Kind regards
Felix



reply via email to

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