[email protected] (Ludovic Courtès) writes: > Hi! > > Thomas Morley <[email protected]> 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
