Re: G::O::I based bindings and problem passing char array ref
- From: "Torsten Schönfeld" <kaffeetisch gmx de>
- To: "GTK-Perl List" <gtk-perl-list gnome org>
- Subject: Re: G::O::I based bindings and problem passing char array ref
- Date: Fri, 3 Jun 2016 09:35:27 +0200
"Jeremy Volkening" <jdv base2bio com>:
I see that the data argument to "new_from_data()" is specified as a
utf-8 char array, but the contents of the PDF files (those that use
compressed blocks) are not actually straight UTF-8. Is it possible
that perl-G:I:O sees the specs and is forcing UTF-8 encoding on the
data at some point?
Yes. If the argument is marked as being a utf8 string, then G:O:I will force the given string to be
utf8-encoded before passing it on.
If I futz with the .gir and change the new_from_data() "data" parameter
type to a guint8 array (and then pass it a character array ref) I can
load and read the page number from most of the files that were
previously throwing errors. Then the script segfaults almost every
time...
Can you provide a backtrace and or Valgrind output?
# gdb --args perl program.pl
(gdb) run
...
(gdb) bt
# valgrind perl program.pl
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]