From d6febc940590716257808b3c0b976f9a8df58e33 Mon Sep 17 00:00:00 2001 From: dlichteblau Date: Sun, 27 Nov 2005 17:34:23 +0000 Subject: [PATCH] -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. ] --- encodings.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/encodings.lisp b/encodings.lisp index 04ddd93..bdd8e99 100644 --- a/encodings.lisp +++ b/encodings.lisp @@ -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)))