Bug 138997 - passwords with 8bit characters fails
Summary: passwords with 8bit characters fails
Status: RESOLVED FIXED
Alias: None
Product: kpdf
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Astals Cid
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-19 08:00 UTC by petrus
Modified: 2007-11-01 00:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description petrus 2006-12-19 08:00:33 UTC
Version:           0.5.5 (using KDE KDE 3.5.5)
Installed from:    Gentoo Packages
OS:                Linux

I have a pdf file which is password protected. The password contains characters that are not in 7bit ascii map and are therefore not unicode compliant. 

Kpdf asks me password when I try to open the pdf but if I press for example one ä it echos it as ** so I guess this is a problem with unicode taking the place of two chars. I can't open the file with kpdf however Adobe reader opens the file very nice.

I'm using UTF-8 charset and when testing with ISO-8859-15 kpdf was able to open the file just nice.
Comment 1 Albert Astals Cid 2006-12-19 21:04:08 UTC
Reassigning to kdelibs as it's a problem on KPasswordDialog, most probably on KPasswordEdit::keyPressEvent
Comment 2 Albert Astals Cid 2006-12-27 00:09:56 UTC
Reassigning to me again as i'm not sure this is a kdelibs bug
Comment 3 cjacker 2007-03-06 05:00:00 UTC
I find this problem when I use spanish keymap and want input spanish password in kdm and kdesktop lockdialog.

this is the patch for it.

you can use "ñÑÑÑÑ" to test it.




--- kpassdlg.cpp        2007-01-15 19:34:22.000000000 +0800
+++ /kpassdlg.cpp       2007-03-06 11:43:46.000000000 +0800
@@ -118,7 +118,7 @@
     else
        m_EchoMode = OneStar;

-    setInputMethodEnabled( true );
+//    setInputMethodEnabled( true );
 }

 KPasswordEdit::KPasswordEdit(QWidget *parent, const char *name, int echoMode)
@@ -160,8 +160,8 @@

 void KPasswordEdit::insert(const QString &txt)
 {
-    const QCString localTxt = txt.local8Bit();
-    const unsigned int lim = localTxt.length();
+    const char * localTxt = txt.latin1();
+    const unsigned int lim = strlen(localTxt);
     const int m_MaxLength = maxPasswordLength();
     for(unsigned int i=0; i < lim; ++i)
     {
@@ -211,9 +211,10 @@
        }
        break;
     default:
-       const unsigned char ke = e->text().local8Bit()[0];
+       const unsigned char ke = e->text().latin1()[0];
        if (ke >= 32) {
-           insert(e->text());
+           //fprintf(stderr,"%s\n\n",e->text().utf8().data());
+           insert(e->text().utf8());
        } else
            e->ignore();
        break;
Comment 4 Albert Astals Cid 2007-11-01 00:18:06 UTC
SVN commit 731536 by aacid:

PDF passwords are latin1, so encode them correctly
BUG: 138997


 M  +1 -1      generator_pdf.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=731536