u8-istream: Fix handling of UTF-8 byte order marks.
[pspp] / tests / libpspp / u8-istream.at
index 985805d7ee0e6605bc24651e0c61a6167f53fda1..9757f9605b7b77fd9d1cf55b3db1403ac479f9f0 100644 (file)
@@ -109,15 +109,20 @@ Auto mode
 entrée
 UTF-8 mode
 ])
+AT_CHECK([printf '\357\273\277entr\303\251e\n' | u8-istream-test read - Auto], [0], [dnl
+UTF-8 mode
+entrée
+UTF-8 mode
+])
 AT_CLEANUP
 
 AT_SETUP([read ISO-8859-1 as Auto,ISO-8859-1])
 AT_KEYWORDS([u8_istream])
 AT_CHECK([i18n-test supports_encodings ISO-8859-1])
 buffer_size=`u8-istream-test buffer-size`
-($PERL -e "print 'x' x int($buffer_size * 2.5)"; printf 'entr\351e\n') > input
+($PERL -e 'print "xyzzy\n" x int('$buffer_size' * 2.5 / 7)'; printf 'entr\351e\n') > input
 (echo "Auto mode"
- $PERL -e "print 'x' x int($buffer_size * 2.5)"
+ $PERL -e 'print "xyzzy\n" x int('$buffer_size' * 2.5 / 7)'
  printf 'entr\303\251e\n') > expout
 AT_CHECK([u8-istream-test read input Auto,ISO-8859-1], [0], [expout])
 AT_CLEANUP