[cl-pdf-devel] latin-2 + sbcl + hungarian characters

Dmitriy Ivanov divanov at aha.ru
Wed Feb 6 15:27:58 UTC 2008


Roland Lohner wrote on Wed, 6 Feb 2008 15:47:03 +0100 17:47:

| A diff of an another useful solution considering you opinion is
| attached. Please take a look at it.

This looks slightly better. Though, IMHO, char-external-code should remain
an ordinary function not generic. Let us introduce sbcl-char-external-code,
for example:

+#+sbcl
+ (defmethod sbcl-char-external-code ((char character) (charset (eql
:latin-2)))
+  (let ((code (call-next-method)))
+    (case code
+      (336 213) ; #\LATIN_CAPITAL_LETTER_O_WITH_DOUBLE_ACUTE
+      (337 245) ; #\LATIN_SMALL_LETTER_O_WITH_DOUBLE_ACUTE
+      (368 219) ; #\LATIN_CAPITAL_LETTER_U_WITH_DOUBLE_ACUTE
+      (369 251) ; #\LATIN_SMALL_LETTER_U_WITH_DOUBLE_ACUTE
+      (otherwise code))))

When SBCL gets a "real" char-external-code converter function in the future,
it will be easier to rewrite just this peace of code.

The final question is whether this approach works for Latin-2 based
languages other than Hungarian. Are you sure all they are mapping these
Unicode characters similarly?
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru




More information about the cl-pdf-devel mailing list