From 56c86d17947bb2a551250bb86b7d600604381eb2 Mon Sep 17 00:00:00 2001
From: rtoy <rtoy>
Date: Sun, 10 Oct 2010 12:52:58 +0000
Subject: [PATCH] In brief_otherptr, the name slot of a symbol was not printing
 out the name correctly for unicode strings.  It stopped after the first 0
 byte, which basically means either nothing or a single byte is printed.  Just
 dump out the entire UTF-16 octets in native byte order.

---
 lisp/print.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/lisp/print.c b/lisp/print.c
index 0b8bac72b..5694f8311 100644
--- a/lisp/print.c
+++ b/lisp/print.c
@@ -1,4 +1,4 @@
-/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/print.c,v 1.25 2009/06/11 16:04:01 rtoy Rel $ */
+/* $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/lisp/print.c,v 1.26 2010/10/10 12:52:58 rtoy Exp $ */
 
 #include <stdio.h>
 #include <string.h>
@@ -376,11 +376,28 @@ brief_otherptr(lispobj obj)
       case type_SymbolHeader:
 	  symbol = (struct symbol *) ptr;
 	  vector = (struct vector *) PTR(symbol->name);
+#ifndef UNICODE
 	  for (charptr = (char *) vector->data; *charptr != '\0'; charptr++) {
 	      if (*charptr == '"')
 		  putchar('\\');
 	      putchar(*charptr);
 	  }
+#else
+          {
+              char *charptr = (char *) vector->data;
+              int len = (int) (vector->length >> 2);
+              
+              while (len-- > 0) {
+                  if ((charptr[0] == 0)
+                      && (charptr[1] = '"')) {
+                      putchar('\\');
+                  }
+                  /* Just dump out the UTF-16 data */
+                  putchar(*charptr++);
+                  putchar(*charptr++);
+              }
+          }
+#endif
 	  break;
 
       case type_SimpleString:
-- 
GitLab