test-command-line-encoding 754 B

12345678910111213141516171819202122232425262728
  1. #!/bin/sh
  2. # Choose a UTF-8 locale. The locale doesn't have to be available on the
  3. # system since `environ_locale_charset' does not actually try to set it.
  4. LC_ALL="en_US.UTF-8"
  5. export LC_ALL
  6. unset LANG
  7. unset LC_CTYPE
  8. exec guile -q -s "$0" "λ"
  9. !#
  10. ;; Make sure our first argument is a lower-case lambda.
  11. ;;
  12. ;; Up to Guile 2.0.3 included, command-line arguments would not be converted
  13. ;; according to the locale settings; see
  14. ;; <http://lists.gnu.org/archive/html/guile-devel/2011-11/msg00026.html> for
  15. ;; details.
  16. (if (string-contains-ci (setlocale LC_ALL) "utf")
  17. (exit (string=? (cadr (program-arguments)) "λ"))
  18. ;; If we can't install a UTF-8 locale, skip the test
  19. (exit 77))
  20. ;; Local Variables:
  21. ;; mode: scheme
  22. ;; coding: utf-8
  23. ;; End: