[Poppler-bugs] [Bug 60517] New: xpdf utilities cannot open files with UTF-8 characters in file path on Windows

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Feb 8 13:46:40 PST 2013


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

          Priority: medium
            Bug ID: 60517
          Assignee: poppler-bugs at lists.freedesktop.org
           Summary: xpdf utilities cannot open files with UTF-8 characters
                    in file path on Windows
          Severity: minor
    Classification: Unclassified
                OS: Windows (All)
          Reporter: aurimas.dev at gmail.com
          Hardware: x86-64 (AMD64)
            Status: NEW
           Version: unspecified
         Component: utils
           Product: poppler

Created attachment 74453
  --> https://bugs.freedesktop.org/attachment.cgi?id=74453&action=edit
PDF test files

pdfinfo and pdftotext (have not tested others) cannot open PDF files with UTF-8
characters in file path.

Environment:

Windows 7 Pro (x64)

poppler.0.22.0_win32: I've been having trouble compiling poppler myself, so I
got poppler.0.22.0_win32 binaries from
http://blog.alivate.com.au/poppler-windows/ (perhaps this is not a problem with
official binaries, which I could not find)

Steps to reproduce:
1. Download PDF test files (or create PDF file with UTF-8 character in the
name, e.g. testα)
2. Open command prompt and navigate to the directory with PDF file
3. Run `chcp 65001` to activate UTF-8 codepage
4. Run `pdfinfo.exe testα.pdf`

Outcome:
`I/O Error: Couldn't open file 'testa.pdf': No such file or directory.`

Note that "testα.pdf" is converted to "testa.pdf"

Using the command line to open that same file with Adobe Acrobat Reader 11.0
worked just fine, so the characters are being correctly passed from the
commandline to the program.

Here's a summary of my tests

>poppler.0.22.0_win32\bin\pdfinfo.exe test.pdf
Tagged:         no
Form:           none
Pages:          1
Encrypted:      no
Page size:      612 x 792 pts (letter)
Page rot:       0
File size:      14622 bytes
Optimized:      no
PDF version:    1.4

>poppler.0.22.0_win32\bin\pdfinfo.exe testα.pdf
I/O Error: Couldn't open file 'testa.pdf': No such file or directory.

>poppler.0.22.0_win32\bin\pdftotext.exe test.pdf

>poppler.0.22.0_win32\bin\pdftotext.exe testα.pdf
I/O Error: Couldn't open file 'testa.pdf': No such file or directory.


Looking at poppler's code, it looks like a win32 version of PDFDoc constructor
is defined in PDFDoc.cc
```
#ifdef _WIN32
PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword,
           GooString *userPassword, void *guiDataA) {
```
but LocalPDFDocBuilder.cc calls the general PDFDoc constructor no matter what
(by always passing a GooString* instead of wchar_t*). Can't test this though,
since I'm having trouble compiling poppler.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20130208/75003e17/attachment.html>


More information about the Poppler-bugs mailing list