Skip to content
Snippets Groups Projects
Commit acaee9c2 authored by rtoy's avatar rtoy
Browse files

o Fix issue with decoding error call. The error function takes 3

  args.
o Generate different error messages for surrogate code points and code
  points that are too large.
parent 2cdf2151
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/extfmts.lisp,v 1.32 2010/07/05 15:52:47 rtoy Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/extfmts.lisp,v 1.33 2010/07/05 22:45:50 rtoy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -639,9 +639,17 @@
(declare (type lisp:codepoint code))
;;@@ on non-Unicode builds, limit to 8-bit chars
;;@@ if unicode-bootstrap, can't use #\u+fffd
(cond ((or (lisp::surrogatep code) (> code #x10FFFF))
(cond ((or (lisp::surrogatep code) (>= code lisp:codepoint-limit))
;; Surrogate characters (that weren't combined
;; into a codepoint by octets-to-codepoint) are
;; illegal. So are codepoints that are too large.
(if ,error
(funcall ,error "Cannot output codepoint #x~X" code)
(if (lisp::surrogatep code)
(funcall ,error
,(format nil "Surrogate codepoint #x~~4,'0X is illegal for ~A"
external-format)
code nil)
(funcall ,error "Illegal codepoint on input: #x~X" code nil))
#-(and unicode (not unicode-bootstrap)) #\?
#+(and unicode (not unicode-bootstrap)) #\U+FFFD))
#+unicode
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment