guile-user
[Top][All Lists]
Advanced

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

Re: guile can't find a chinese named file


From: David Kastrup
Subject: Re: guile can't find a chinese named file
Date: Mon, 30 Jan 2017 16:48:13 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Hi!
>
> Thomas Morley <address@hidden> 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?

address@hidden:/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=
address@hidden:/usr/local/tmp/lilypond$ touch /tmp/f♯.scm
address@hidden:/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"
address@hidden:/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




reply via email to

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