[Poppler-bugs] [Bug 35378] Poppler::Document::load() function fails on some MS-Windows configurations

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Mar 17 04:26:10 PDT 2011


https://bugs.freedesktop.org/show_bug.cgi?id=35378

--- Comment #2 from yoch <yoch.melka at gmail.com> 2011-03-17 04:26:10 PDT ---
(In reply to comment #1)
> Unless you can provide precise examples of what is wrong i don't know how you
> expect us to fix anything.

The trouble is that it works for me... This bug occurs on Systems like
MS-Windows Seven in hebrew, or MS-Windows Seven x64 in French, etc. The problem
is clearly that the load() function fails on some systems, and that document is
not initialized.

I looked at the sources of poppler-qt4, notament poppler-document.cc, and I
think that the problem depends on the use of the function QFile:: EncodeName ()

In the documentation of Qt, section QString::toLocal8Bit(), it says:
"If this string contains"any characters encoded That Can not Be In The Local,
The Returned byte array is undefined. Those characters suppressed Gold May Be
Replaced by Another."

For example, you can solve this problem by calling loadFromData() since the
load() function, like this :

Document *Document::load(const QString &filePath, const QByteArray
&ownerPassword, const QByteArray &userPassword)
{
    QFile file(filePath);
    if (!file.open(QIODevice::ReadOnly))
        return NULL;

    QByteArray data = file.read( file.size() ); file.close();
    return loadFromData(data);
}

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list