[cxml-cvs] CVS update: cxml/runes/encodings.lisp

David Lichteblau dlichteblau at common-lisp.net
Sun Nov 27 17:34:24 UTC 2005


Update of /project/cxml/cvsroot/cxml/runes
In directory common-lisp.net:/tmp/cvs-serv5138/runes

Modified Files:
	encodings.lisp 
Log Message:
-xmltest/not-wf/sa/170.xml [not validating:] FAILED:
-  well-formedness violation not detected
-[
-    Four byte UTF-8 encodings can encode UCS-4 characters
-    which are beyond the range of legal XML characters
-    (and can't be expressed in Unicode surrogate pairs).
-    This document holds such a character.  ]

Date: Sun Nov 27 18:34:23 2005
Author: dlichteblau

Index: cxml/runes/encodings.lisp
diff -u cxml/runes/encodings.lisp:1.2 cxml/runes/encodings.lisp:1.3
--- cxml/runes/encodings.lisp:1.2	Sun Nov 27 18:19:12 2005
+++ cxml/runes/encodings.lisp	Sun Nov 27 18:34:23 2005
@@ -160,8 +160,10 @@
                  `((lambda (x)
                      (when (or (<= #xD800 x #xDBFF)
 			       (<= #xDC00 x #xDFFF))
-		       (xerror "surrogate encoded in UTF-8: #x~x." x))
-                     (cond ((%> x #xFFFF)
+		       (xerror "surrogate encoded in UTF-8: #x~X." x))
+                     (cond ((%> x #x10FFFF)
+                            (xerror "not a valid code point: #x~X" x))
+		           ((%> x #xFFFF)
                             (setf (aref out (%+ 0 wptr)) (%+ #xD7C0 (ash x -10))
                                   (aref out (%+ 1 wptr)) (%ior #xDC00 (%and x #x3FF)))
                             (setf wptr (%+ wptr 2)))




More information about the Cxml-cvs mailing list