From: David Kastrup <dak@gnu.org>
To: guile-user@gnu.org
Subject: Re: guile can't find a chinese named file
Date: Mon, 30 Jan 2017 16:48:13 +0100 [thread overview]
Message-ID: <87tw8gr1ky.fsf@fencepost.gnu.org> (raw)
In-Reply-To: 874m0gd3z4.fsf@gnu.org
ludo@gnu.org (Ludovic Courtès) writes:
> Hi!
>
> Thomas Morley <thomasmorley65@gmail.com> skribis:
>
>> guile filename_名字.scm
>> ;;; Stat of /home/hermann/Desktop/filename_??.scm failed:
>> ;;; ERROR: In procedure stat: No such file or directory:
>> "/home/hermann/Desktop/filename_\u540d\u5b57.scm"
>> Backtrace:
>> In ice-9/boot-9.scm:
>> 160: 8 [catch #t #<catch-closure 55cae58fe4e0> ...]
>> In unknown file:
>> ?: 7 [apply-smob/1 #<catch-closure 55cae58fe4e0>]
>> In ice-9/boot-9.scm:
>> 66: 6 [call-with-prompt prompt0 ...]
>> In ice-9/eval.scm:
>> 432: 5 [eval # #]
>> In ice-9/boot-9.scm:
>> 2404: 4 [save-module-excursion #<procedure 55cae59209c0 at
>> ice-9/boot-9.scm:4051:3 ()>]
>> 4058: 3 [#<procedure 55cae59209c0 at ice-9/boot-9.scm:4051:3 ()>]
>> 1727: 2 [%start-stack load-stack ...]
>> 1732: 1 [#<procedure 55cae5935db0 ()>]
>> In unknown file:
>> ?: 0 [primitive-load "/home/hermann/Desktop/filename_\u540d\u5b57.scm"]
>>
>> ERROR: In procedure primitive-load:
>> ERROR: In procedure open-file: No such file or directory:
>> "/home/hermann/Desktop/filename_\u540d\u5b57.scm"
>
> In C, argv is just an array of byte sequences, but in Guile,
> (command-line) returns a list of strings, not a list of bytevectors.
>
> Guile decodes its arguments according to the encoding of the current
> locale. So if you’re in a UTF-8 locale (say, zn_CH.utf8 or en_US.utf8),
> Guile assumes its command-line arguments are UTF-8-encoded and decodes
> them accordingly.
>
> In the example above, it seems that the file name encoding was different
> from the locale encoding, leading to this error.
>
> HTH!
Did you actually test this?
dak@lola:/usr/local/tmp/lilypond$ locale
LANG=en_US.UTF-8
LANGUAGE=en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US.UTF-8
LC_COLLATE="en_US.UTF-8"
LC_MONETARY=en_US.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=
dak@lola:/usr/local/tmp/lilypond$ touch /tmp/f♯.scm
dak@lola:/usr/local/tmp/lilypond$ guile-2.0 /tmp/f♯.scm
;;; Stat of /tmp/f?.scm failed:
;;; ERROR: In procedure stat: No such file or directory: "/tmp/f\u266f.scm"
Backtrace:
In ice-9/boot-9.scm:
160: 8 [catch #t #<catch-closure a0a4710> ...]
In unknown file:
?: 7 [apply-smob/1 #<catch-closure a0a4710>]
In ice-9/boot-9.scm:
66: 6 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
432: 5 [eval # #]
In ice-9/boot-9.scm:
2404: 4 [save-module-excursion #<procedure a0b5ce0 at ice-9/boot-9.scm:4051:3 ()>]
4056: 3 [#<procedure a0b5ce0 at ice-9/boot-9.scm:4051:3 ()>]
1727: 2 [%start-stack load-stack ...]
1732: 1 [#<procedure a0bb690 ()>]
In unknown file:
?: 0 [primitive-load "/tmp/f\u266f.scm"]
ERROR: In procedure primitive-load:
ERROR: In procedure open-file: No such file or directory: "/tmp/f\u266f.scm"
dak@lola:/usr/local/tmp/lilypond$ ls -l /tmp/f*.scm
-rw-rw-r-- 1 dak dak 0 Jan 30 16:42 /tmp/f♯.scm
--
David Kastrup
next prev parent reply other threads:[~2017-01-30 15:48 UTC|newest]
Thread overview: 110+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-27 11:58 guile can't find a chinese named file Thomas Morley
2016-11-27 12:16 ` Chaos Eternal
2016-11-28 8:54 ` Thomas Morley
2017-01-26 21:59 ` Linas Vepstas
2017-01-30 14:20 ` Ludovic Courtès
2017-01-30 15:48 ` David Kastrup [this message]
2017-01-30 16:41 ` Ludovic Courtès
2017-01-30 17:04 ` David Kastrup
2017-01-30 15:54 ` Marko Rauhamaa
2017-01-30 16:19 ` David Kastrup
2017-01-30 16:33 ` Marko Rauhamaa
2017-01-30 16:42 ` David Kastrup
2017-01-30 17:58 ` Marko Rauhamaa
2017-01-30 18:32 ` David Kastrup
2017-01-30 18:50 ` Eli Zaretskii
2017-01-30 19:00 ` David Kastrup
2017-01-30 19:32 ` Eli Zaretskii
2017-01-30 19:59 ` Eli Zaretskii
2017-01-30 20:42 ` Mike Gran
2017-01-31 3:31 ` Eli Zaretskii
2017-01-31 6:16 ` Mike Gran
2017-01-31 8:51 ` David Kastrup
2017-01-30 19:01 ` Marko Rauhamaa
2017-01-30 19:27 ` David Kastrup
2017-02-14 20:10 ` Linas Vepstas
2017-02-14 20:54 ` Mike Gran
2017-02-14 21:07 ` Marko Rauhamaa
2017-02-14 21:52 ` Mike Gran
2017-02-14 22:12 ` Marko Rauhamaa
2017-02-14 22:19 ` Chris Vine
2017-02-15 7:15 ` Marko Rauhamaa
2017-02-15 9:18 ` tomas
2017-02-15 9:54 ` David Kastrup
2017-02-15 10:10 ` tomas
2017-02-15 17:04 ` Eli Zaretskii
2017-02-15 20:07 ` tomas
2017-02-15 20:22 ` Eli Zaretskii
2017-02-15 10:50 ` Marko Rauhamaa
2017-02-15 11:18 ` David Kastrup
2017-02-15 10:15 ` Chris Vine
2017-02-15 11:48 ` tomas
2017-02-15 12:13 ` Chris Vine
2017-02-15 12:41 ` tomas
2017-02-15 13:11 ` Chris Vine
2017-02-15 13:31 ` tomas
2017-02-15 17:07 ` Eli Zaretskii
2017-02-26 20:58 ` Andy Wingo
2017-02-27 16:02 ` Eli Zaretskii
2017-02-26 20:52 ` Andy Wingo
2017-02-15 16:59 ` Eli Zaretskii
2017-02-15 17:53 ` Marko Rauhamaa
2017-02-15 20:20 ` tomas
2017-02-15 20:32 ` Eli Zaretskii
2017-02-15 21:04 ` Marko Rauhamaa
2017-02-16 5:44 ` Eli Zaretskii
2017-02-16 6:15 ` Marko Rauhamaa
2017-02-16 6:29 ` Eli Zaretskii
2017-02-16 6:41 ` Eli Zaretskii
2017-02-16 7:16 ` Marko Rauhamaa
2017-02-16 8:26 ` David Kastrup
2017-02-16 10:21 ` Marko Rauhamaa
2017-02-16 10:43 ` David Kastrup
2017-02-16 11:04 ` Marko Rauhamaa
2017-02-16 11:11 ` David Kastrup
2017-02-16 11:32 ` Marko Rauhamaa
2017-02-16 11:49 ` David Kastrup
2017-02-16 12:14 ` Marko Rauhamaa
2017-02-16 16:21 ` Eli Zaretskii
2017-02-16 16:38 ` Marko Rauhamaa
2017-02-16 17:46 ` Eli Zaretskii
2017-02-16 18:38 ` Marko Rauhamaa
2017-02-16 18:46 ` Eli Zaretskii
2017-02-16 19:35 ` Marko Rauhamaa
2017-02-16 20:10 ` Eli Zaretskii
2017-02-16 20:52 ` David Kastrup
2017-02-16 21:13 ` Marko Rauhamaa
2017-02-17 6:44 ` Eli Zaretskii
2017-02-17 8:46 ` Marko Rauhamaa
2017-02-17 9:04 ` David Kastrup
2017-02-17 9:57 ` tomas
2017-02-17 9:07 ` Eli Zaretskii
2017-02-17 6:32 ` Eli Zaretskii
2017-02-16 16:06 ` Eli Zaretskii
2017-02-16 16:35 ` Marko Rauhamaa
2017-02-16 17:41 ` Eli Zaretskii
2017-02-16 18:30 ` Mike Gran
2017-02-16 18:48 ` David Kastrup
2017-02-16 7:02 ` Marko Rauhamaa
2017-02-16 15:47 ` Eli Zaretskii
2017-02-15 21:15 ` tomas
2017-02-16 5:54 ` Eli Zaretskii
2017-02-14 23:58 ` David Kastrup
2017-02-15 10:12 ` tomas
2017-02-15 12:04 ` Marko Rauhamaa
2017-02-26 21:20 ` Andy Wingo
2017-02-27 9:10 ` David Kastrup
2017-02-27 11:02 ` Andy Wingo
2017-02-27 12:09 ` David Kastrup
2017-02-27 12:33 ` Andy Wingo
2017-02-27 16:07 ` Eli Zaretskii
2017-02-27 19:29 ` Andy Wingo
2017-02-27 20:24 ` Jan Wedekind
2017-02-27 20:33 ` Eli Zaretskii
2017-02-14 22:26 ` Ludovic Courtès
2017-02-26 21:23 ` Andy Wingo
2017-01-30 19:41 ` Eli Zaretskii
2017-01-30 20:46 ` Marko Rauhamaa
2017-01-31 12:20 ` tomas
2017-02-14 19:58 ` Linas Vepstas
2017-02-26 21:33 ` Andy Wingo
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://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87tw8gr1ky.fsf@fencepost.gnu.org \
--to=dak@gnu.org \
--cc=guile-user@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.
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).