<html>
    <head>
      <base href="https://bugs.freedesktop.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - poppler-glib: poppler_document_new_from_data() receives data as UTF-8 string not binary"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=104961">104961</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>poppler-glib: poppler_document_new_from_data() receives data as UTF-8 string not binary
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>glib frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>okimoto@clear-code.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=137181" name="attach_137181" title="Add type annotation to poppler_document_new_from_data()">attachment 137181</a> <a href="attachment.cgi?id=137181&action=edit" title="Add type annotation to poppler_document_new_from_data()">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=104961&attachment=137181'>[review]</a>
Add type annotation to poppler_document_new_from_data()

In Poppler-0.18.gir poppler_document_new_from_data() is defined as following:

      <constructor name="new_from_data"
                   c:identifier="poppler_document_new_from_data"
                   throws="1">
        <doc xml:space="preserve">Creates a new #PopplerDocument.  If %NULL is
returned, then @error will be
set. Possible errors include those in the #POPPLER_ERROR and #G_FILE_ERROR
domains.</doc>
        <return-value transfer-ownership="full">
          <doc xml:space="preserve">A newly created #PopplerDocument, or
%NULL</doc>
          <type name="Document" c:type="PopplerDocument*"/>
        </return-value>
        <parameters>
          <parameter name="data" transfer-ownership="none">
            <doc xml:space="preserve">the pdf data contained in a char
array</doc>
            <type name="utf8" c:type="char*"/>
          </parameter>
          <parameter name="length" transfer-ownership="none">
            <doc xml:space="preserve">the length of #data</doc>
            <type name="gint" c:type="int"/>
          </parameter>
          <parameter name="password"
                     transfer-ownership="none"
                     nullable="1"
                     allow-none="1">
            <doc xml:space="preserve">password to unlock the file with, or
%NULL</doc>
            <type name="utf8" c:type="const char*"/>
          </parameter>
        </parameters>
      </constructor>


This definition validates data as UTF-8 string when read a PDF data using
poppler_document_new_from_data() via gobject-introspection.
In general, PDF data is not UTF-8 string. So we should treat parameter data as
binary.

I wrote tiny patch and confirm that the poppler_document_new_from_data()
definition is updated after applied this patch.
However, I'm not familiar with gobject-introspection in honest.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>