[cl-pdf-devel] latin-2 + sbcl + hungarian characters
Roland Lohner
lohner.roland at gmail.com
Tue Feb 5 18:22:11 UTC 2008
Dear List,
I use cl-pdf with sbcl and latin-2 encoded fonts.
A serious problem occurs with 4 hungarian characters. Instead of these
characters some other characters are rendered in the document. These are:
#\LATIN_CAPITAL_LETTER_O_WITH_DOUBLE_ACUTE (Ő) ---> P
#\LATIN_SMALL_LETTER_O_WITH_DOUBLE_ACUTE (ő) ----> Q
#\LATIN_CAPITAL_LETTER_U_WITH_DOUBLE_ACUTE (Ű) ----> p
#\LATIN_SMALL_LETTER_U_WITH_DOUBLE_ACUTE (ű) -----> q
The reason is, that 'write-to-page ((string string) (encoding
single-byte-encoding) &optional escape) writes in a character stream,
without setting the character encoding to latin-2. So these 4 hungarian
characters are not mapped properly to their single byte representation in
latin-2 and only the lower byte of the character codes are written in the
document.
0x150 -> 0x50 (P)
0x151 -> 0x51 (Q)
0x170 -> 0x70 (p)
0x171 -> 0x71 (q)
An svn diff is included to this mail. It solves the problem via use of
function 'char-external-code and definition of *latin-2-charset*. This patch
solves my problem. Please take a look at the attached patch. Unless there
are objections or suggestions, Attila Lendvai will commit it eventually.
Regards,
Roland Lohner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cl-pdf-devel/attachments/20080205/3d2b3c57/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sbcl-latin2-hun.svndiff
Type: application/octet-stream
Size: 2609 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/cl-pdf-devel/attachments/20080205/3d2b3c57/attachment.obj>
More information about the cl-pdf-devel
mailing list