mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 23:50:19 +02:00
Arrange to convert command-line arguments from the right encoding.
This is a temporary workaround for the 2.0 stable series. The next stable series should have an implicit `setlocale (LC_ALL, "")' call, which will make this unnecessary. * libguile/feature.c (progargs_fluid): Rename to... (scm_program_arguments_fluid): ... this. Update users. * libguile/feature.h (scm_program_arguments_fluid): New internal declaration. * libguile/init.c (invoke_main_func): Call `scm_i_set_boot_program_arguments' instead of `scm_set_program_arguments'. * libguile/script.c (locale_arguments_to_string_list, scm_i_set_boot_program_arguments): New functions. (scm_compile_shell_switches): Use `locale_arguments_to_string_list'. * libguile/script.h (scm_i_set_boot_program_arguments): New internal declaration. * test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add `test-command-line-encoding'. * test-suite/standalone/test-command-line-encoding: New file.
This commit is contained in:
parent
c2c2b5a49b
commit
ed4c373966
7 changed files with 81 additions and 11 deletions
24
test-suite/standalone/test-command-line-encoding
Executable file
24
test-suite/standalone/test-command-line-encoding
Executable file
|
@ -0,0 +1,24 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Choose a UTF-8 locale. The locale doesn't have to be available on the
|
||||
# system since `environ_locale_charset' does not actually try to set it.
|
||||
LC_ALL="en_US.UTF-8"
|
||||
export LC_ALL
|
||||
unset LANG
|
||||
unset LC_CTYPE
|
||||
|
||||
exec guile -q -s "$0" "λ"
|
||||
!#
|
||||
|
||||
;; Make sure our first argument is a lower-case lambda.
|
||||
;;
|
||||
;; Up to Guile 2.0.3 included, command-line arguments would not be converted
|
||||
;; according to the locale settings; see
|
||||
;; <http://lists.gnu.org/archive/html/guile-devel/2011-11/msg00026.html> for
|
||||
;; details.
|
||||
(exit (string=? (cadr (program-arguments)) "λ"))
|
||||
|
||||
;; Local Variables:
|
||||
;; mode: scheme
|
||||
;; coding: utf-8
|
||||
;; End:
|
Loading…
Add table
Add a link
Reference in a new issue