l...@gnu.org (Ludovic Courtès) writes: > Nala Ginrut <nalagin...@gmail.com> skribis: >> + setlocale (LC_ALL, ""); > > Currently, like in C, it’s the programmer’s responsibility to install > the locale with such a call, and none of Guile’s business.
Unfortunately, I don't see a way for the user to call setlocale before a Guile script converts the command-line arguments to Scheme strings, at least not without providing their own `main' function in C. It wouldn't be too hard to postpone the conversion until the first time (command-line) or (program-arguments) is called. That would change the semantics somewhat, e.g. if the program modifies the argv[] array before the first call to (command-line), but it might still be a worthwhile change. However, what should we do about scripts that use `-e'? For example: #!/usr/local/bin/guile \ -e main -s !# (define (main args) (display args) (newline)) I think we should consider decoding the command-line arguments using the locale specified by the environment variables, at least in cases like this where there's no way for the user to call setlocale before the conversion happens. Mark