From: Christophe Rhodes Date: Sun, 14 Apr 2013 19:01:18 +0000 (+0100) Subject: improve normalize-string X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=cdb078bfba518e29216773677cc72a86ca0ef7f7;p=sbcl.git improve normalize-string * now works on non-simple strings; * more likely to be correct under #!-sb-unicode --- diff --git a/src/code/target-char.lisp b/src/code/target-char.lisp index 1a932cd..6791452 100644 --- a/src/code/target-char.lisp +++ b/src/code/target-char.lisp @@ -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)))