X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Ftarget-char.lisp;h=e217f8e8dbcb04925974211b044db475512328f0;hb=88429c4045707ceaf99a10801d5c5efdca765afa;hp=fdd7b9c92c6f25fcff939b3c6e3522d2f1233262;hpb=db0110475c0db5dc3cb1bb12de0b0c475880899e;p=sbcl.git diff --git a/src/code/target-char.lisp b/src/code/target-char.lisp index fdd7b9c..e217f8e 100644 --- a/src/code/target-char.lisp +++ b/src/code/target-char.lisp @@ -62,11 +62,13 @@ (dpb (aref info (+ (* 4 j) 2)) (byte 8 8) (aref info (+ (* 4 j) 3))))))) - (dotimes (i (/ (length info) 12) table) + #!+sb-unicode + (dotimes (i (/ (length info) 12)) (setf (gethash (dpb (code (* 3 i)) (byte 21 21) (code (1+ (* 3 i)))) table) - (code-char (code (+ (* 3 i) 2)))))))) + (code-char (code (+ (* 3 i) 2))))) + table))) (defun !character-database-cold-init () (setf **character-database** ,character-database)) ,(with-open-file (stream (file "ucd-names" "lisp-expr") @@ -511,7 +513,7 @@ is either numeric or alphabetic." (defmacro equal-char-code (character) (let ((ch (gensym))) `(let ((,ch ,character)) - (if (= (ucd-value-0 ,ch) 0) + (if (< (ucd-value-0 ,ch) 4) (ucd-value-1 ,ch) (char-code ,ch))))) @@ -836,10 +838,17 @@ character exists." (defun normalize-string (string &optional (form :nfd)) (declare (type (member :nfd :nfkd :nfc :nfkc) form)) + #!-sb-unicode + (etypecase string + ((array nil (*)) string) + (string + (ecase form + ((:nfc :nfkc) string) + ((:nfd :nfkd) (error "Cannot normalize to ~A form in #-SB-UNICODE builds" form))))) + #!+sb-unicode (etypecase string - #!+sb-unicode (base-string string) - ((or (array character (*)) #!-sb-unicode base-string) + ((array character (*)) (ecase form ((:nfc) (canonically-compose (sort-combiners (decompose-string string))))