improve normalize-string
authorChristophe Rhodes <csr21@cantab.net>
Sun, 14 Apr 2013 19:01:18 +0000 (20:01 +0100)
committerChristophe Rhodes <csr21@cantab.net>
Sat, 18 May 2013 19:04:04 +0000 (20:04 +0100)
* now works on non-simple strings;
* more likely to be correct under #!-sb-unicode

src/code/target-char.lisp

index 1a932cd..6791452 100644 (file)
@@ -799,11 +799,12 @@ character exists."
 (defun normalize-string (string &optional (form :nfd))
   (declare (type (member :nfd :nfkd :nfc :nfkc) form))
   (etypecase string
-    (simple-base-string string)
-    ((simple-array character (*))
+    #!+sb-unicode
+    (base-string string)
+    ((or (array character (*)) #!-sb-unicode base-string)
      (ecase form
        ((:nfd)
         (sort-combiners (decompose-string string)))
        ((:nfkd)
         (sort-combiners (decompose-string string :compatibility)))))
-    ((simple-array nil (*)) string)))
+    ((array nil (*)) string)))