From: Christophe Rhodes Date: Mon, 27 May 2013 07:11:05 +0000 (+0100) Subject: fix CHAR-EQUALity of non-ascii caseful characters X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=88429c4045707ceaf99a10801d5c5efdca765afa;p=sbcl.git fix CHAR-EQUALity of non-ascii caseful characters Or at least mostly fix it. There are issues surrounding iota subscript and titlecase, which aren't regressions in the current release and will require some more investigation to fix. --- diff --git a/src/code/target-char.lisp b/src/code/target-char.lisp index 395a894..e217f8e 100644 --- a/src/code/target-char.lisp +++ b/src/code/target-char.lisp @@ -513,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))))) diff --git a/tests/character.pure.lisp b/tests/character.pure.lisp index 95c5833..c84b463 100644 --- a/tests/character.pure.lisp +++ b/tests/character.pure.lisp @@ -126,3 +126,18 @@ ((1 . ,(1- char-code-limit)))) &optional)) (sb-impl::%fun-type f))))) + +(with-test (:name (:case-insensitive-char-comparisons :eacute)) + (assert (char-equal (code-char 201) (code-char 233)))) + +(with-test (:name (:case-insensitive-char-comparisons :exhaustive) + :fails-on '(and)) + (dotimes (i char-code-limit) + (let* ((char (code-char i)) + (down (char-downcase char)) + (up (char-upcase char))) + (assert (char-equal char char)) + (when (char/= char down) + (assert (char-equal char down))) + (when (char/= char up) + (assert (char-equal char up))))))