[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[pdf-devel] Problem with pdf_text_new_from_unicode
From: |
derhans |
Subject: |
[pdf-devel] Problem with pdf_text_new_from_unicode |
Date: |
Sat, 2 May 2009 06:52:23 -0400 (EDT) |
User-agent: |
SquirrelMail/1.4.13 |
Hi everybody,
I have some trouble using pdf_text_new_from_unicode. It would be great if
someone could help. Here is what I'm doing:
pdf_text_t path;
pdf_char_t pathname[] = "DOESNTEXIST";
fail_if( pdf_text_init() != PDF_OK );
fail_if( pdf_text_new_from_unicode(pathname,
strlen((char*)
pathname),
PDF_TEXT_UTF8,
&path) != PDF_OK );
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.
1. All parameters passed to pdf_text_new_from_unicode seem to be ok
2. The error happens within pdf_text_set_unicode called in pdf-text.c line
424
3. Within that, pdf_text_utf8_to_utf32he is called (pdf-text.c 944) which
seems to cause the problem.
- data is allocated with the right size 44 (pdf-text-encoding.c 896)
- The characters are copied correctly to utf32val and utf8val
- In line 936:
memcpy(&(data[j]), &(utf32val), 4);
doesn't seem to work, data always contains just the first character
of the input string
Could you please have a look and let me know what you think.
Please let me know if you need further information/details.
regards,
Hans
- [pdf-devel] Problem with pdf_text_new_from_unicode,
derhans <=