kbd.scm unicode problem

DoneSubmitted by Guy Ze Grant.
Details
2 participants
  • Guy Ze Grant
  • Ludovic Courtès
Owner
unassigned
Severity
normal
G
G
Guy Ze Grant wrote on 14 Oct 2013 10:14
(address . bug-guix@gnu.org)
8911b57e425d728f6dd5087409c29e22.squirrel@fruiteater.riseup.net
I was asked to post here, so here it is; Attached is my expression thusfar for kbd, at the patch phase though -- the following issue pops up:"find-files: ./doc/utf/??????: No such file or directory", along with aspew of guile barf following (which you can see in the kbd.scm.log file).
Not sure if it's a pertaining to my lack of experience, or if it'ssomething actually wrong with guix itself, but might as-well through itoff to the experts. :^)
Attachment: kbd.scm
Attachment: kbd.scm.log
L
L
Ludovic Courtès wrote on 16 Oct 2013 15:32
(name . Guy Ze Grant)(address . gzg@riseup.net)(address . 15608@debbugs.gnu.org)
871u3lfiiy.fsf@gnu.org
"Guy Ze Grant" <gzg@riseup.net> skribis:
Toggle quote (5 lines)> I was asked to post here, so here it is; Attached is my expression thus> far for kbd, at the patch phase though -- the following issue pops up:> "find-files: ./doc/utf/??????: No such file or directory", along with a> spew of guile barf following (which you can see in the kbd.scm.log file).
As we discussed on IRC, the problem is that POSIX considers file namesto be just byte strings, and the encoding is up to the application, andlocale-dependent by default. In practice people typically use UTF-8(GLib and friends expect that.)
Here’s the problem and fix:
Toggle snippet (15 lines)$ echo $LANGen_US.UTF-8
$ ls -a. .. ♪♬
$ guile -c '(use-modules (ice-9 ftw)) (pk (scandir "."))'
;;; (("." ".." "??????"))
$ guile -c '(use-modules (ice-9 ftw)) (setlocale LC_ALL "en_US.utf8") (pk (scandir "."))'
;;; (("." ".." "♪♬"))
In the first run Guile uses the “C” locale, so it’s unable to decode “♪♬”.
In the second run it uses a UTF-8 locale, so everything works fine.
Back to kbd: can you add a phase after the ‘unpack’ phase that justdoes this?
(setlocale "LC_ALL" "en_US.utf8")
If that works we can probably make it the default in the ‘core-updates’branch.
Toggle quote (2 lines)> (define-module (gnu packages kbd)
Since kbd is Linux-specific, could you put it in (gnu packages linux)?
[...]
Toggle quote (6 lines)> 102: 1 [patch-source-shebangs # ...]> In unknown file:> ?: 0 [sort # #<procedure string<? (#:optional _ _ . _)>]>> ERROR: In procedure sort:> ERROR: In procedure list-copy: Wrong type argument in position 1: ("./config/ylwrap" "./config/install-sh" "./config/depcomp" "./config/config.sub" "./config/config.rpath" "./config/missing" "./config/config.guess" "./config/mkinstalldirs" "./config/compile" "./
[...]
Toggle quote (2 lines)> " "./doc/utf/README" "./doc/utf/ethiopic" . #f)
It’s also a bug that ‘find-files’ returns a improper list whenencountering such an issue. I’ll fit it in ‘core-updates’.
Thanks,Ludo’.
L
L
Ludovic Courtès wrote on 10 Dec 2013 22:59
(name . Guy Ze Grant)(address . gzg@riseup.net)(address . 15608@debbugs.gnu.org)
87k3fctlia.fsf@gnu.org
ludo@gnu.org (Ludovic Courtès) skribis:
Toggle quote (5 lines)> Back to kbd: can you add a phase after the ‘unpack’ phase that just> does this?>> (setlocale "LC_ALL" "en_US.utf8")
Did you try this?
What happened to the kdb package definition?
Thanks,Ludo’.
L
L
Ludovic Courtès wrote on 30 Dec 2013 17:06
request
(address . request@debbugs.gnu.org)
874n5qe32e.fsf@gnu.org
close 15209tag 15608 moreinfothanks
L
L
Ludovic Courtès wrote on 28 Feb 2014 12:16
Re: bug#15608: kbd.scm unicode problem
(name . Guy Ze Grant)(address . gzg@riseup.net)(address . 15608@debbugs.gnu.org)
87bnxr5vy7.fsf@gnu.org
ludo@gnu.org (Ludovic Courtès) skribis:
Toggle quote (11 lines)> ludo@gnu.org (Ludovic Courtès) skribis:>>> Back to kbd: can you add a phase after the ‘unpack’ phase that just>> does this?>>>> (setlocale "LC_ALL" "en_US.utf8")>> Did you try this?>> What happened to the kdb package definition?
Ping!
Ludo’.
L
L
Ludovic Courtès wrote on 17 Jun 2014 14:20
(name . Guy Ze Grant)(address . gzg@riseup.net)(address . 15608-done@debbugs.gnu.org)
87egynenhn.fsf@gnu.org
Two things have happened:
1. Commit f135276 fixed ‘find-files’ to gracefully handle file names that use an unsupported encoding.
2. I packaged kdb (commit b10e9ff6), which works nicely.
Thanks,Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 15608@debbugs.gnu.org