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: derhans
Subject: Re: [pdf-devel] Problem with pdf_text_new_from_unicode
Date: Sat, 2 May 2009 11:40:04 -0400 (EDT)
User-agent: SquirrelMail/1.4.13

>> 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
>

Dear Aleksander,

thank you for your help. I didn't printf() path->data, but accessed it
within ddd as I did with the pdf_char_t data in pdf_text_utf8_to_utf32he.
Unfortunately the output seems to be terminated here too. You hint helped
me to find my original problem (which was totally unrelated to strings and
encoding).
Thank you very much and have a nice weekend.

regards,

Hans






reply via email to

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