]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Perform the lang-* tests both in a traditional locale and in a UTF-8 locale,
authorBruno Haible <bruno@clisp.org>
Tue, 15 Feb 2005 14:48:11 +0000 (14:48 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:12:16 +0000 (12:12 +0200)
as far as provided by the system.

25 files changed:
gettext-tools/ChangeLog
gettext-tools/configure.ac
gettext-tools/m4/ChangeLog
gettext-tools/m4/locale-fr.m4
gettext-tools/tests/ChangeLog
gettext-tools/tests/Makefile.am
gettext-tools/tests/lang-bash
gettext-tools/tests/lang-c
gettext-tools/tests/lang-c++
gettext-tools/tests/lang-clisp
gettext-tools/tests/lang-csharp
gettext-tools/tests/lang-gawk
gettext-tools/tests/lang-guile
gettext-tools/tests/lang-java
gettext-tools/tests/lang-librep
gettext-tools/tests/lang-objc
gettext-tools/tests/lang-pascal
gettext-tools/tests/lang-perl-1
gettext-tools/tests/lang-perl-2
gettext-tools/tests/lang-php
gettext-tools/tests/lang-python-1
gettext-tools/tests/lang-python-2
gettext-tools/tests/lang-sh
gettext-tools/tests/lang-smalltalk
gettext-tools/tests/lang-tcl

index d352d8c1429d6e1f8ea37fb06f987658ab808c28..08a1bf386a674f86762a78726344ebd3f304445b 100644 (file)
@@ -1,3 +1,7 @@
+2005-02-13  Bruno Haible  <bruno@clisp.org>
+
+       * configure.ac: Invoke gt_LOCALE_FR_UTF8.
+
 2005-02-13  Bruno Haible  <bruno@clisp.org>
 
        * configure.ac: Invoke gl_FUNC_STRTOUL. Keep AC_CHECK_FUNCS(strtoul)
index 8756f3a9344e3b6c53d728c8e9b7f3724ca906db..9a3536f5421de9300e64eef51db69ec62e090ab8 100644 (file)
@@ -240,6 +240,7 @@ AC_SUBST(CROSS_COMPILING)
 dnl Checks for optional programs for the tests/lang-* tests.
 gt_PROG_ANSI_CXX
 gt_LOCALE_FR
+gt_LOCALE_FR_UTF8
 
 dnl Check whether to execute tests that rely on libasprintf.
 dnl This test must be consistent with gettext-runtime/configure.ac.
index daf2d19ebec9ad279bd362b4ed5d75554af5a03d..f89e6e229ccf723676bfb38f38a998acf166b6b4 100644 (file)
@@ -1,3 +1,9 @@
+2005-02-13  Bruno Haible  <bruno@clisp.org>
+
+       * locale-fr.m4 (gt_LOCALE_FR): If no locale was found or if the OS is
+       Darwin7, use 'none' instead of 'fr_FR'.
+       (gt_LOCALE_FR_UTF8): New macro.
+
 2005-02-13  Bruno Haible  <bruno@clisp.org>
 
        * strtoul.m4: New file, from gnulib.
index 6fcb67d48894025e57e5a6ab737150086debbbe2..6c83f9eed5ddab2c724385d0b66f013a16eeeb45 100644 (file)
@@ -1,5 +1,5 @@
-# locale-fr.m4 serial 1 (gettext-0.13)
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
+# locale-fr.m4 serial 2 (gettext-0.14.2)
+dnl Copyright (C) 2003, 2005 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -9,9 +9,26 @@ dnl From Bruno Haible.
 dnl Determine the name of a french locale with traditional encoding.
 AC_DEFUN([gt_LOCALE_FR],
 [
+  AC_REQUIRE([AC_CANONICAL_HOST])
   AC_CACHE_CHECK([for a traditional french locale], gt_cv_locale_fr, [
+    macosx=
+    case "$host_os" in
+      darwin[56]*) ;;
+      darwin*) macosx=yes;;
+    esac
+    if test -n "$macosx"; then
+      # On Darwin 7 (MacOS X), the libc supports some locales in non-UTF-8
+      # encodings, but the kernel does not support them. The documentation
+      # says:
+      #   "... all code that calls BSD system routines should ensure
+      #    that the const *char parameters of these routines are in UTF-8
+      #    encoding. All BSD system functions expect their string
+      #    parameters to be in UTF-8 encoding and nothing else."
+      # See the comments in config.charset. Therefore we bypass the test.
+      gt_cv_locale_fr=none
+    else
 changequote(,)dnl
-    cat <<EOF > conftest.$ac_ext
+      cat <<EOF > conftest.$ac_ext
 #include <locale.h>
 #include <time.h>
 struct tm t;
@@ -28,42 +45,103 @@ int main () {
 }
 EOF
 changequote([,])dnl
-    if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
-      # Test for the usual locale name.
-      if (LC_ALL=fr_FR ./conftest; exit) 2>/dev/null; then
-        gt_cv_locale_fr=fr_FR
-      else
-        # Test for the locale name with explicit encoding suffix.
-        if (LC_ALL=fr_FR.ISO-8859-1 ./conftest; exit) 2>/dev/null; then
-          gt_cv_locale_fr=fr_FR.ISO-8859-1
+      if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+        # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+        # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+        # configure script would override the LC_ALL setting.
+        # Test for the usual locale name.
+        if (LC_ALL=fr_FR LC_TIME= ./conftest; exit) 2>/dev/null; then
+          gt_cv_locale_fr=fr_FR
         else
-          # Test for the AIX, OSF/1, FreeBSD, NetBSD locale name.
-          if (LC_ALL=fr_FR.ISO8859-1 ./conftest; exit) 2>/dev/null; then
-            gt_cv_locale_fr=fr_FR.ISO8859-1
+          # Test for the locale name with explicit encoding suffix.
+          if (LC_ALL=fr_FR.ISO-8859-1 LC_TIME= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr=fr_FR.ISO-8859-1
           else
-            # Test for the HP-UX locale name.
-            if (LC_ALL=fr_FR.iso88591 ./conftest; exit) 2>/dev/null; then
-              gt_cv_locale_fr=fr_FR.iso88591
+            # Test for the AIX, OSF/1, FreeBSD, NetBSD locale name.
+            if (LC_ALL=fr_FR.ISO8859-1 LC_TIME= ./conftest; exit) 2>/dev/null; then
+              gt_cv_locale_fr=fr_FR.ISO8859-1
             else
-              # Test for the Solaris 7 locale name.
-              if (LC_ALL=fr ./conftest; exit) 2>/dev/null; then
-                gt_cv_locale_fr=fr
+              # Test for the HP-UX locale name.
+              if (LC_ALL=fr_FR.iso88591 LC_TIME= ./conftest; exit) 2>/dev/null; then
+                gt_cv_locale_fr=fr_FR.iso88591
               else
-                # Special test for NetBSD 1.6.
-                if test -f /usr/share/locale/fr_FR.ISO8859-1/LC_CTYPE; then
-                  gt_cv_locale_fr=fr_FR.ISO8859-1
+                # Test for the Solaris 7 locale name.
+                if (LC_ALL=fr LC_TIME= ./conftest; exit) 2>/dev/null; then
+                  gt_cv_locale_fr=fr
                 else
-                  # None found.
-                  gt_cv_locale_fr=fr_FR
+                  # Special test for NetBSD 1.6.
+                  if test -f /usr/share/locale/fr_FR.ISO8859-1/LC_CTYPE; then
+                    gt_cv_locale_fr=fr_FR.ISO8859-1
+                  else
+                    # None found.
+                    gt_cv_locale_fr=none
+                  fi
                 fi
               fi
             fi
           fi
         fi
       fi
+      rm -fr conftest*
     fi
-    rm -fr conftest*
   ])
   LOCALE_FR=$gt_cv_locale_fr
   AC_SUBST([LOCALE_FR])
 ])
+
+dnl Determine the name of a french locale with UTF-8 encoding.
+AC_DEFUN([gt_LOCALE_FR_UTF8],
+[
+  AC_CACHE_CHECK([for a french Unicode locale], gt_cv_locale_fr_utf8, [
+changequote(,)dnl
+    cat <<EOF > conftest.$ac_ext
+#include <locale.h>
+#include <time.h>
+struct tm t;
+char buf[16];
+int main () {
+  /* On BeOS, locales are not implemented in libc.  Rather, libintl
+     imitates locale dependent behaviour by looking at the environment
+     variables, and all locales use the UTF-8 encoding.  */
+#if !defined(__BEOS__)
+  /* Check whether the given locale name is recognized by the system.  */
+  if (setlocale (LC_ALL, "") == NULL) return 1;
+  /* Check whether in the abbreviation of the second month, the second
+     character (should be U+00E9: LATIN SMALL LETTER E WITH ACUTE) is
+     two bytes long, with UTF-8 encoding.  */
+  t.tm_year = 1975 - 1900; t.tm_mon = 2 - 1; t.tm_mday = 4;
+  if (strftime (buf, sizeof (buf), "%b", &t) < 4
+      || buf[1] != (char) 0xc3 || buf[2] != (char) 0xa9 || buf[3] != 'v')
+    return 1;
+#endif
+  return 0;
+}
+EOF
+changequote([,])dnl
+    if AC_TRY_EVAL([ac_link]) && test -s conftest$ac_exeext; then
+      # Setting LC_ALL is not enough. Need to set LC_TIME to empty, because
+      # otherwise on MacOS X 10.3.5 the LC_TIME=C from the beginning of the
+      # configure script would override the LC_ALL setting.
+      # Test for the usual locale name.
+      if (LC_ALL=fr_FR LC_TIME= ./conftest; exit) 2>/dev/null; then
+        gt_cv_locale_fr_utf8=fr_FR
+      else
+        # Test for the locale name with explicit encoding suffix.
+        if (LC_ALL=fr_FR.UTF-8 LC_TIME= ./conftest; exit) 2>/dev/null; then
+          gt_cv_locale_fr_utf8=fr_FR.UTF-8
+        else
+          # Test for the Solaris 7 locale name.
+          if (LC_ALL=fr.UTF-8 LC_TIME= ./conftest; exit) 2>/dev/null; then
+            gt_cv_locale_fr_utf8=fr.UTF-8
+          else
+            # None found.
+            gt_cv_locale_fr_utf8=none
+          fi
+        fi
+      fi
+    fi
+    rm -fr conftest*
+  ])
+  LOCALE_FR_UTF8=$gt_cv_locale_fr_utf8
+  AC_SUBST([LOCALE_FR_UTF8])
+])
index f8522face77b54abcc401bef1f5a2130bf12818f..46e03a290322906534a778640e76afd8594f6bf1 100644 (file)
@@ -1,3 +1,29 @@
+2005-02-13  Bruno Haible  <bruno@clisp.org>
+
+       * Makefile.am (TESTS_ENVIRONMENT): Define also the environment variable
+       LOCALE_FR_UTF8.
+       * lang-bash: Don't test using the traditional french locale if it does
+       exist. Try not only the traditional french locale, but also the UTF-8
+       locale, if it exists.
+       * lang-c: Likewise.
+       * lang-c++: Likewise.
+       * lang-clisp: Likewise.
+       * lang-csharp: Likewise.
+       * lang-gawk: Likewise.
+       * lang-guile: Likewise.
+       * lang-java: Likewise.
+       * lang-librep: Likewise.
+       * lang-objc: Likewise.
+       * lang-perl-1: Likewise.
+       * lang-perl-2: Likewise.
+       * lang-php: Likewise.
+       * lang-sh: Likewise.
+       * lang-smalltalk: Likewise.
+       * lang-tcl: Likewise.
+       * lang-pascal: Likewise, but disable the test of the UTF-8 locale.
+       * lang-python-1: Likewise.
+       * lang-python-2: Likewise.
+
 2005-02-12  Bruno Haible  <bruno@clisp.org>
 
        * lang-clisp: Use only the first line of "clisp --version"'s output.
index 80d79b44b3363dd3cdffea9c77358f7f12341974..5d4610382c1901d3424d66bb5c5677bbb3ed29f0 100644 (file)
@@ -149,6 +149,7 @@ TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) \
                    TESTCSHARP='@TESTCSHARP@' \
                    TESTLIBASPRINTF='@TESTLIBASPRINTF@' \
                    LOCALE_FR='@LOCALE_FR@' \
+                   LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
                    host_os='@host_os@' \
                    CONFIG_SHELL='$(SHELL)' \
                    $(SHELL)
index 0fff7e3e5384ce53529966827b9917be5d0780b9..f9397b0996b70e622bc642f054c232b0e3b730cb 100755 (executable)
@@ -89,16 +89,30 @@ case `bash -c 'echo $BASH_VERSION'` in
   *) rm -fr $tmpfiles; exit 77;;
 esac
 
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-
-tmpfiles="$tmpfiles prog.nok prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
+
+tmpfiles="$tmpfiles prog.nok prog.ok prog.oku prog.out"
 # Expected result when bash is built without i18n support.
 cat <<\EOF > prog.nok
 'Your command, please?', asked the waiter.
@@ -109,12 +123,25 @@ cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR bash ./prog.sh 2 > prog.out || exit 1
-: ${DIFF=diff}
-${DIFF} prog.nok prog.out > /dev/null && { rm -fr $tmpfiles; exit 77; }
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR bash ./prog.sh 2 > prog.out || exit 1
+  : ${DIFF=diff}
+  ${DIFF} prog.nok prog.out > /dev/null && { rm -fr $tmpfiles; exit 77; }
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 bash ./prog.sh 2 > prog.out || exit 1
+  : ${DIFF=diff}
+  ${DIFF} prog.nok prog.out > /dev/null && { rm -fr $tmpfiles; exit 77; }
+  ${DIFF} prog.oku prog.out || exit 1
+fi
 
 rm -fr $tmpfiles
 
index 90ac388b537b19bdc5220e9eb7ce44316164755f..21f1907efb672cccc549a8439935d888133a375b 100755 (executable)
@@ -113,22 +113,40 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= ./prog $LOCALE_FR 2 > prog.out
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= ./prog $LOCALE_FR 2 > prog.out
+  case $? in
+    0) ${DIFF} prog.ok prog.out || exit 1;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= ./prog $LOCALE_FR_UTF8 2 > prog.out
+  case $? in
+    0) ${DIFF} prog.oku prog.out || exit 1;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles
 
index 496ad2f1874788a66e5969135c9532634e4402dc..59bb399e69841d7e2176e7e9d7fea45e7332c933 100755 (executable)
@@ -126,22 +126,40 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= ./prog $LOCALE_FR 2 > prog.out
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= ./prog $LOCALE_FR 2 > prog.out
+  case $? in
+    0) ${DIFF} prog.ok prog.out || exit 1;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= ./prog $LOCALE_FR_UTF8 2 > prog.out
+  case $? in
+    0) ${DIFF} prog.oku prog.out || exit 1;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles
 
index d8b0460a9b2e92026391c12e967fa03d7faaa385..dcd8b88fb0b2c9156c4b120719f1d3c38c99aa81 100755 (executable)
@@ -96,26 +96,52 @@ clisp -norc -x "(sys::exit #+GETTEXT (not (>= $version 2.28)) #-GETTEXT t)" \
       >/dev/null \
   || { rm -fr $tmpfiles; exit 77; }
 
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-
-tmpfiles="$tmpfiles prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
+
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-CLISP_LANGUAGE= LANGUAGE= LC_ALL=$LOCALE_FR clisp prog.lisp 2 > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  CLISP_LANGUAGE= LANGUAGE= LC_ALL=$LOCALE_FR clisp prog.lisp 2 > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  CLISP_LANGUAGE= LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 clisp prog.lisp 2 > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
 
 rm -fr $tmpfiles
 
index 424c7fc49e0d950d6e5e353c8804706db0608601..27a4c86eb5777702ff59186afd85329edd80ce62 100755 (executable)
@@ -98,27 +98,53 @@ tmpfiles="$tmpfiles fr/prog.dll"
 GETTEXTCSHARPLIBDIR=../../gettext-runtime/intl-csharp \
 ${MSGFMT} --csharp -d . -r prog -l fr fr.po || exit 1
 
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-
-tmpfiles="$tmpfiles prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
+
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 : ${CSHARPEXEC="/bin/sh ../lib/csharpexec.sh"}
-LANGUAGE= LC_ALL=$LOCALE_FR ${CSHARPEXEC} -L ../../gettext-runtime/intl-csharp program.exe 2 > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR ${CSHARPEXEC} -L ../../gettext-runtime/intl-csharp program.exe 2 > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 ${CSHARPEXEC} -L ../../gettext-runtime/intl-csharp program.exe 2 > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
 
 rm -fr $tmpfiles
 
index b81441d8d5248d5442a7d5bbcae03a572ea8ccb2..5a104fc0b0d91e1d95fc5d811d45dbd96afb55e3 100755 (executable)
@@ -89,31 +89,64 @@ case `gawk --version 2>&1 | sed -e 's/^[^0-9]*//'` in
     rm -fr $tmpfiles; exit 77;;
 esac
 
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 # Test that gawk wasn't built with --disable-nls.
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR gawk --version | grep logiciel > /dev/null
-test $? = 0 || { rm -fr $tmpfiles; exit 77; }
-
-tmpfiles="$tmpfiles prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR gawk --version | grep logiciel > /dev/null
+  test $? = 0 || { rm -fr $tmpfiles; exit 77; }
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 gawk --version | grep logiciel > /dev/null
+  test $? = 0 || { rm -fr $tmpfiles; exit 77; }
+fi
+
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR gawk -v n=2 -f prog.awk > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR gawk -v n=2 -f prog.awk > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 gawk -v n=2 -f prog.awk > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
 
 rm -fr $tmpfiles
 
index a73beab8407295264297e30659bf2ccd4a2c3f15..79c949599fc323116dc5f4d660203c19fda6bf61 100755 (executable)
@@ -92,26 +92,52 @@ case `guile --version | sed -e 1q | sed -e 's/^[^0-9]*//'` in
     rm -fr $tmpfiles; exit 77;;
 esac
 
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-
-tmpfiles="$tmpfiles prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
+
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR guile -s prog.scm 2 > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR guile -s prog.scm 2 > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 guile -s prog.scm 2 > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
 
 rm -fr $tmpfiles
 
index 6ef57b24d5d666f19cee26d378b48c9dad0f2be2..a9eb2bac847da595a59a4fb6719c1cb25ad6f699 100755 (executable)
@@ -110,27 +110,53 @@ tmpfiles="$tmpfiles prog_fr.class"
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -j -d . -r prog -l fr fr.po || exit 1
 
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-
-tmpfiles="$tmpfiles prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
+
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
 : ${JAVAEXEC="/bin/sh ../lib/javaexec.sh"}
-LANGUAGE= LC_ALL=$LOCALE_FR CLASSPATH=.:../../gettext-runtime/intl-java/libintl.jar ${JAVAEXEC} Program 2 > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR CLASSPATH=.:../../gettext-runtime/intl-java/libintl.jar ${JAVAEXEC} Program 2 > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 CLASSPATH=.:../../gettext-runtime/intl-java/libintl.jar ${JAVAEXEC} Program 2 > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
 
 rm -fr $tmpfiles
 
index fda3e948f55c71750dafee810f6994ba558acbc2..5b8840ac76864fc1c0de613094d770367ac7facb 100755 (executable)
@@ -75,25 +75,50 @@ case `rep --version | sed -e 's/^[^0-9]*//'` in
     rm -fr $tmpfiles; exit 77;;
 esac
 
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-
-tmpfiles="$tmpfiles prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
+
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR rep --no-rc --batch prog.jl > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR rep --no-rc --batch prog.jl > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 rep --no-rc --batch prog.jl > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
 
 rm -fr $tmpfiles
 
index cc3280fe1f1f667650dcddf5d89de26beab36202..53f7ae69043b98cdd1871cca21b605296890de1c 100755 (executable)
@@ -127,22 +127,40 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= ./prog $LOCALE_FR 2 > prog.out
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= ./prog $LOCALE_FR 2 > prog.out
+  case $? in
+    0) ${DIFF} prog.ok prog.out || exit 1;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= ./prog $LOCALE_FR_UTF8 2 > prog.out
+  case $? in
+    0) ${DIFF} prog.oku prog.out || exit 1;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles
 
index 1f13e48bc1a3ad0ba5041c91cc6fb582e2c55444..46cb24aafe7335e0c12280f375c81524eac424ce 100755 (executable)
@@ -3,6 +3,11 @@
 # Test of gettext facilities in the Object Pascal language.
 # Assumes the following packages are installed: fpk.
 
+# Note: This test fails with fpk 1.0.10 when an UTF-8 locale is present,
+# because fpk ignores the locale's encoding. It supports only unibyte locales.
+# This here is a quick workaround:
+LOCALE_FR_UTF8=none
+
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
@@ -76,17 +81,32 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL= LC_MESSAGES= LC_CTYPE= LANG=$LOCALE_FR ./prog > prog.out || exit 1
-: ${DIFF=diff}
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL= LC_MESSAGES= LC_CTYPE= LANG=$LOCALE_FR ./prog > prog.out || exit 1
+  : ${DIFF=diff}
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL= LC_MESSAGES= LC_CTYPE= LANG=$LOCALE_FR_UTF8 ./prog > prog.out || exit 1
+  : ${DIFF=diff}
+  ${DIFF} prog.oku prog.out || exit 1
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles
 
index 8bdbd0448563d572eb57c83c8c054a782113dafc..ccd2d85ffcb832457d4417d08fdaae0405c43d2d 100755 (executable)
@@ -57,7 +57,7 @@ msgstr ""
 "Plural-Forms: nplurals=2; plural=(n > 1);\n"
 
 msgid "'Your command, please?', asked the waiter."
-msgstr "Votre commande, s'il vous plait, dit le gar�n."
+msgstr "«Votre commande, s'il vous plait», dit le garçon."
 
 # Les gateaux allemands sont les meilleurs du monde.
 #, perl-format
@@ -86,10 +86,15 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
-Votre commande, s'il vous plait, dit le gar�n.
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
@@ -99,8 +104,18 @@ perl -e 'use Locale::Messages;' 2>/dev/null \
   || { rm -fr $tmpfiles; exit 77; }
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LANG=$LOCALE_FR LC_MESSAGES= LC_CTYPE= LC_ALL= perl program.pl > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LANG=$LOCALE_FR LC_MESSAGES= LC_CTYPE= LC_ALL= perl program.pl > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LANG=$LOCALE_FR_UTF8 LC_MESSAGES= LC_CTYPE= LC_ALL= perl program.pl > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles
 
index f9868b20e7330c2e6a5552223f2467b9b469b491..940aaeea5b34ead3d40ece4dd2c2de606d8ae862 100755 (executable)
@@ -85,21 +85,36 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 # Test for perl with libintl-perl package.
 perl -M'Locale::TextDomain' -e '' 2>/dev/null \
   || { rm -fr $tmpfiles; exit 77; }
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LANG=$LOCALE_FR LC_MESSAGES= LC_CTYPE= LC_ALL= perl program.pl > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LANG=$LOCALE_FR LC_MESSAGES= LC_CTYPE= LC_ALL= perl program.pl > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LANG=$LOCALE_FR_UTF8 LC_MESSAGES= LC_CTYPE= LC_ALL= perl program.pl > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles
 
index f5468b84be80786aa4a1ed35d3db79309e418f2d..77de6cee8271ee17112b34d55a841e2287a10e83 100755 (executable)
@@ -71,25 +71,50 @@ case `(php -v) 2>/dev/null` in
   *) rm -fr $tmpfiles; exit 77;;
 esac
 
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-
-tmpfiles="$tmpfiles prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
+
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR php -q prog.php > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR php -q prog.php > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 php -q prog.php > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
 
 rm -fr $tmpfiles
 
index 7801b2cf747c35dfe7fcf75de27fb822eeb60815..40b686e8bbe9db6e323c219269ef2485b6982ab3 100755 (executable)
@@ -2,6 +2,10 @@
 
 # Test of gettext facilities in the Python language.
 
+# Note: This test fails with Python 2.3, 2.4 when an UTF-8 locale is present.
+# It looks like a bug in Python's gettext.py. This here is a quick workaround:
+LOCALE_FR_UTF8=none
+
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
@@ -72,16 +76,30 @@ case `python -c 'import sys; print sys.hexversion >= 0x20000F0'` in
   *) rm -fr $tmpfiles; exit 77;;
 esac
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR python prog.py > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR python prog.py > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 python prog.py > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles
 
index 5719f4b0c680ad19c9430bac5508f54dde618d6d..70f889afaacda403abd2436c62d798458d4a7ec6 100755 (executable)
@@ -3,6 +3,10 @@
 # Test of gettext facilities (including plural handling) in the Python
 # language.
 
+# Note: This test fails with Python 2.3, 2.4 when an UTF-8 locale is present.
+# It looks like a bug in Python's gettext.py. This here is a quick workaround:
+LOCALE_FR_UTF8=none
+
 tmpfiles=""
 trap 'rm -fr $tmpfiles' 1 2 3 15
 
@@ -91,17 +95,32 @@ case `python -c 'import sys; print sys.hexversion >= 0x20300F0'` in
   *) rm -fr $tmpfiles; exit 77;;
 esac
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR python prog.py 2 > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR python prog.py 2 > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 python prog.py 2 > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles
 
index 000cfec4e809a182e487e6604a183806679a47fc..baca02a6b03d0b1afbf1961223bda2b9138470b7 100755 (executable)
@@ -79,25 +79,50 @@ test -d fr/LC_MESSAGES || mkdir fr/LC_MESSAGES
 : ${MSGFMT=msgfmt}
 ${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
 
-# Test whether the fr_FR locale is installed.
+# Test which of the fr_FR locales are installed.
 : ${LOCALE_FR=fr_FR}
-LC_ALL=$LOCALE_FR ./testlocale
-case $? in
-  0) ;;
-  77) rm -fr $tmpfiles; exit 77;;
-  *) exit 1;;
-esac
-
-tmpfiles="$tmpfiles prog.ok prog.out"
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LC_ALL=$LOCALE_FR ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LC_ALL=$LOCALE_FR_UTF8 ./testlocale
+  case $? in
+    0) ;;
+    77) LOCALE_FR_UTF8=none;;
+    *) exit 1;;
+  esac
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
+
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 2 morceaux de gateau
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR sh ./prog.sh 2 > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR sh ./prog.sh 2 > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 sh ./prog.sh 2 > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
 
 rm -fr $tmpfiles
 
index 53d310c181e09515033d2f5ef456ae33d3984fa4..31ff30543d8d475cf9c7c4b4e87ce608c02ed8ec 100755 (executable)
@@ -101,7 +101,7 @@ case `gst --version | sed -n -e 1p | sed -e 's/^[^0-9]*//'` in
     rm -fr $tmpfiles; exit 77;;
 esac
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 Loading package I18N
@@ -109,10 +109,26 @@ Loading package I18N
 2 morceaux de gateau
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+Loading package I18N
+«Votre commande, s'il vous plait», dit le garçon.
+2 morceaux de gateau
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LC_ALL=$LOCALE_FR gst -Q prog.st > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR gst -Q prog.st > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LC_ALL=$LOCALE_FR_UTF8 gst -Q prog.st > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles
 
index a26a041a7be9e670b025da7a74af6b22c9fb0082..c4d4b5e8becdb0086eedcd9ec1f04b7697396a10 100755 (executable)
@@ -74,16 +74,30 @@ EOF
 (tclsh version.tcl) >/dev/null 2>/dev/null \
   || { rm -fr $tmpfiles; exit 77; }
 
-tmpfiles="$tmpfiles prog.ok prog.out"
+tmpfiles="$tmpfiles prog.ok prog.oku prog.out"
 : ${DIFF=diff}
 cat <<\EOF > prog.ok
 «Votre commande, s'il vous plait», dit le garçon.
 EUR remplace FF.
 EOF
+cat <<\EOF > prog.oku
+«Votre commande, s'il vous plait», dit le garçon.
+EUR remplace FF.
+EOF
 
 : ${LOCALE_FR=fr_FR}
-LANGUAGE= LANG=$LOCALE_FR LC_MESSAGES= LC_CTYPE= LC_ALL= tclsh program.tcl > prog.out || exit 1
-${DIFF} prog.ok prog.out || exit 1
+: ${LOCALE_FR_UTF8=fr_FR.UTF-8}
+if test $LOCALE_FR != none; then
+  LANGUAGE= LANG=$LOCALE_FR LC_MESSAGES= LC_CTYPE= LC_ALL= tclsh program.tcl > prog.out || exit 1
+  ${DIFF} prog.ok prog.out || exit 1
+fi
+if test $LOCALE_FR_UTF8 != none; then
+  LANGUAGE= LANG=$LOCALE_FR_UTF8 LC_MESSAGES= LC_CTYPE= LC_ALL= tclsh program.tcl > prog.out || exit 1
+  ${DIFF} prog.oku prog.out || exit 1
+fi
+if test $LOCALE_FR = none && test $LOCALE_FR_UTF8 = none; then
+  rm -fr $tmpfiles; exit 77
+fi
 
 rm -fr $tmpfiles