pdf-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pdf-devel] Problem with pdf_text_new_from_unicode


From: Aleksander Morgado
Subject: Re: [pdf-devel] Problem with pdf_text_new_from_unicode
Date: Sat, 02 May 2009 15:50:18 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090409)

This is taken from some test code I'm writing. The call to
pdf_text_new_from_unicode returns PDF_OK as, but path->data contains only
the first character of pathname. So I debugged this with the following
result.

Please, take into account that pdf_text_t is opaque, so you shouldn't need to access path->data. Not sure what you mean with only first character being stored in path->data anyway... The pdf_text_t object stores the string in UTF-32HE, which in most cases is UTF-32LE. This means that for an ASCII string, each byte is expanded into 4 bytes. For example, in UTF-32LE you would get:

'A'  -> 'A''/0''/0''/0'
'A''B' -> 'A''/0''/0''/0' 'B''/0''/0''/0'

Is this what you see? I mean, if you try to printf() path->data, of course you will get only first character, as printf() will stop in the first NUL byte. printf() can't be used with UTF-32.

-Aleksander




reply via email to

[Prev in Thread] Current Thread [Next in Thread]