Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: D07multibyte.ztst failure on HP-UX 11.11



On Thu, 7 May 2009 22:08:19 +0000
Paul Ackersviller <pda@xxxxxxxxxxxxxxxx> wrote:
> > This means your test still fails, however.  I'm not sure what to do about
> > this since clearly the test *does* fail; you don't get a valid character or
> > an error.  Since character set conversion isn't working on your system (as
> > evinced by the result of not setting the C locale), I suppose we could test
> > that and if so skip the test?
> 
> Sounds like about the best that can be done under the circumstances.

OK, let's do the following.  It prints a message but avoids looking like a
shell bug if character set conversion doesn't work in a simple case.

Index: Test/D07multibyte.ztst
===================================================================
RCS file: /cvsroot/zsh/zsh/Test/D07multibyte.ztst,v
retrieving revision 1.32
diff -u -r1.32 D07multibyte.ztst
--- Test/D07multibyte.ztst	7 May 2009 16:04:42 -0000	1.32
+++ Test/D07multibyte.ztst	8 May 2009 14:19:38 -0000
@@ -378,17 +378,25 @@
 >X$'\300'Y$'\a'Z$'\177'T
 
 # This also isn't strictly multibyte and is here to reduce the
-# likelihood of a "can't do character set conversion" error.
-  testfn() { (LC_ALL=C; print $'\u00e9') }
-  repeat 4 testfn 2>&1 | while read line; do
-    if [[ $line = *"character not in range"* ]]; then
-      print OK
-    elif [[ $line = "?" ]]; then
-      print OK
-    else
-      print Failed: no error message and no question mark
-    fi
-  done
+# likelihood of a "cannot do character set conversion" error.
+  (print $'\u00e9') 2>&1 | read
+  if [[ $REPLY != Ã ]]; then
+    print "warning: your system can't do simple Unicode conversion." >&$ZTST_fd
+    print "Check you have a correctly installed iconv library." >&$ZTST_fd
+    # cheat
+    repeat 4 print OK
+  else
+    testfn() { (LC_ALL=C; print $'\u00e9') }
+    repeat 4 testfn 2>&1 | while read line; do
+      if [[ $line = *"character not in range"* ]]; then
+        print OK
+      elif [[ $line = "?" ]]; then
+        print OK
+      else
+        print Failed: no error message and no question mark
+      fi
+    done
+  fi
   true
 0:error handling in Unicode quoting
 >OK



-- 
Peter Stephenson <pws@xxxxxxx>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070



Messages sorted by: Reverse Date, Date, Thread, Author