Hi,<br><br>In SBCL result of the expression (type-of (code-char 244)) is extended-char, so pdf-string can not handle unicode strings. See my patch.<br><br>Moskvitin Andrey<br><br>--- <br><br>diff --git a/pdf.lisp b/pdf.lisp<br>
index 16d8f6f..b54b5a6 100644<br>--- a/pdf.lisp<br>+++ b/pdf.lisp<br>@@ -235,21 +235,20 @@<br> (setq unicode (notevery #+lispworks #'lw:base-char-p<br> #-lispworks (lambda (char) (<= (char-code char) 255))<br>
string)))<br>- (with-output-to-string (stream nil :element-type 'base-char)<br>- (write-char #\( stream)<br>- (when unicode ; write the Unicode byte order marker U+FEFF<br>
- (write-char #.(code-char 254) stream) (write-char #.(code-char 255) stream))<br>+ (with-output-to-string (stream nil :element-type 'base-char)<br>+ (if unicode<br>+ (write-string "<FEFF" stream)<br>
+ (write-char #\( stream))<br> (loop for char across string<br> for code = (char-code char)<br> if unicode<br>- do (write-char (code-char (ldb (byte 8 8) code)) stream) ; hi<br>
- (write-char (code-char (ldb (byte 8 0) code)) stream) ; lo<br>+ do (format stream "~4,'0x" code)<br> else if (> code 255)<br> do (write-char (code-char (ldb (byte 8 0) code)) stream) ; lo<br>
else do (case char ((#\( #\) #\\)<br> (write-char #\\ stream)))<br> (write-char char stream))<br>- (write-char #\) stream))))<br>+ (write-char (if unicode #\> #\)) stream))))<br>
<br> (defmacro with-outline-level ((title ref-name) &body body)<br> `(unwind-protect<br><br>