+2004-08-13 Bruno Haible <bruno@clisp.org>
+
+ Fix test failures on MacOS X.
+ * lang-clisp: Skip the test if clisp was not built with gettext
+ support.
+ * lang-java: Enforce encoding ISO-8859-1 for System.out.
+
2004-07-10 Bruno Haible <bruno@clisp.org>
* tstgettext.c (expand_escape): Don't go into an endless loop when the
: ${MSGFMT=msgfmt}
${MSGFMT} -o fr/LC_MESSAGES/prog.mo fr.po
-# Test for presence of clisp version 2.28 or newer.
+# Test for presence of clisp version 2.28 or newer with gettext support.
# Use clisp for the comparison of the version numbers; neither 'expr' nor 'bc'
# can deal with floating-point numbers.
(clisp --version) >/dev/null 2>/dev/null \
rm -fr $tmpfiles; exit 77;;
esac
version=`echo $version | sed -e 's/^\([0-9]*\.[0-9]*\).*/\1/'`
-clisp -norc -x "(sys::exit (not (>= $version 2.28)))" >/dev/null \
+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.
tmpfiles="$tmpfiles Program.java"
cat <<\EOF > Program.java
import java.util.*;
+import java.io.*;
import java.text.*;
import gnu.gettext.*;
// Some systems (like Solaris) don't set Locale.getDefault()
// as specified by LC_ALL. So set it by hand.
Locale.setDefault(new Locale("fr","FR"));
+ // Some systems (like MacOS X) don't set System.out's character encoding
+ // to ISO-8859-1, which is what we need for comparison purposes.
+ try {
+ System.setOut(new PrintStream(new FileOutputStream(FileDescriptor.out),
+ true, "ISO-8859-1"));
+ } catch (UnsupportedEncodingException e) {
+ }
int n = Integer.parseInt(args[0]);
ResourceBundle catalog = ResourceBundle.getBundle("prog");
System.out.println(GettextResource.gettext(catalog,"'Your command, please?', asked the waiter."));