Version: v0.3 (using KDE 3.1.94 (CVS >= 20031206), compiled sources) Compiler: gcc version 3.3.2 OS: Linux (i686) release 2.6.0 When in an UTF-8 locale, KPDF can't open any files whose names contain non-ASCII letters, both names in the command-line and in the Open File dialog. The error I get in the screen is the same. When using a standard Latin1 locale, this doesn't happen. The following errors come from a Latin1 Konsole so that all characters are visible: $ LANG=pt_BR.UTF-8 kpdf /tmp/Namárië.pdf Error: Couldn't open file '/tmp/Namárië.pdf' $ LANG=pt_BR kpdf /tmp/Namárië.pdf [file is opened correctly] $ LANG=el_GR kpdf /tmp/Namárië.pdf Error: Couldn't open file '/tmp/Nam??ri?«.pdf' $ touch /tmp/¤ $ LANG=fr_FR@euro kpdf /tmp/¤ Error: Couldn't open file '/tmp/?' Somehow KPDF isn't using the proper functions to handle filenames. It's very likely converting the names into Latin1 when trying to open it, instead of using QFile::encoding.
The bugzilla page and the e-mail sent by Bugzilla are correctly encoded in UTF-8. In all kpdf command-lines you should be seeing 9 letters between /tmp/ and .pdf. If you don't, change the settings in your browser/mail reader.
I can't reproduce this bug report. I have moved a pdf to the name /tmp/tést.pdf and it opens fine, both from the command line as the open file dialog. unconfirming. cheers domi
Nope, still happening for me. Note: you need to have a file whose name is not ASCII and you have to be in a non-Latin1 or Latin9 locale. UTF-8 serves best. I noted up above that Latin1 worked.
*** Bug 72667 has been marked as a duplicate of this bug. ***
Oops, sorry for the mishap. I mistook kpf for kpdf. I might add that this is still happening for me as of HEAD 20031222.
Forwarding to the bug report; the file will be attached to it. ---------- ---------- Subject: Solving bug #70947 Date: Qua 03 Mar 2004 21:07 From: Henrique Pinto <henrique.pinto@kdemail.net> To: oelewapperke@wina.be Cc: thiago.macieira@kdemail.net Hi! I recently had the same problem Thiago reported. After a quick check of the code, I discovered where the bug was lying and created the tiny patch attached to this message, that solves the problem for me. Can I commit this? Thank you! -- Henrique Pinto henrique.pinto@kdemail.net ------------------------------------------------------- --- kpdf_part.cpp 2004-01-10 16:49:40.000000000 -0200 +++ /home/henrique/kpdf_part.cpp 2004-03-03 20:47:52.000000000 -0300 @@ -351,7 +351,7 @@ if (file.open(IO_ReadOnly) == false) return false; - GString* filename = new GString(m_file.ascii()); + GString* filename = new GString( QFile::encodeName( m_file ) ); m_doc = new PDFDoc(filename, 0, 0); if (!m_doc->isOk())
Created attachment 5010 [details] Henrique's patch solving the problem No, that didn't work. Here goes through Bugzilla.
> No, that didn't work. Strange... Very strange... It works like a charm for me... Anyway, I still think the patch should be applied, as the filename shouldn't be converted to ASCII. I'll check other potential sources of errors related to this.
>> No, that didn't work. > Strange... Very strange... It works like a charm for me... I meant that sending an e-mail to the bug report did not attach the file to it. It pasted the contents instead.
CVS commit by pinto: Support non-ASCII filenames. CCMAIL: 70947-done@bugs.kde.org M +1 -1 kpdf_part.cpp 1.47 --- kdegraphics/kpdf/kpdf/kpdf_part.cpp #1.46:1.47 @@ -352,5 +352,5 @@ Part::openFile() return false; - GString* filename = new GString(m_file.ascii()); + GString* filename = new GString( QFile::encodeName( m_file ) ); m_doc = new PDFDoc(filename, 0, 0);