Changeset 15848


Ignore:
Timestamp:
Jun 22, 2013, 8:59:00 PM (6 years ago)
Author:
gb
Message:

%GET-NATIVE-UTF-16-CSTRING: utf-16-combine-surrogate-pairs returns a
CHARACTER.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-0/l0-misc.lisp

    r15752 r15848  
    460460          (let* ((code (%get-unsigned-word pointer i)))
    461461            (declare (type (unsigned-byte 16) code))
    462             (when (and (>= code #xd800)
    463                        (< code #xdc00))
    464               (incf i 2)
    465               (let* ((code2 (%get-unsigned-word pointer i)))
    466                 (declare (type (unsigned-byte 16) code2))
    467                 (setq code (utf-16-combine-surrogate-pairs code code2))))
    468             (setf (schar string out) (code-char code)))))
     462            (cond ((and (>= code #xd800)
     463                        (< code #xdc00))
     464                   (incf i 2)
     465                   (let* ((code2 (%get-unsigned-word pointer i)))
     466                     (declare (type (unsigned-byte 16) code2))
     467                     (setf (schar string out)
     468                           (utf-16-combine-surrogate-pairs code code2))))
     469                  (t (setf (schar string out) (code-char code)))))))
    469470    (when (and (>= code #xd800) (< code #xdc00))
    470471      (incf i 2))))
Note: See TracChangeset for help on using the changeset viewer.