Bug 189984

Summary: Impossible to email images if the path contains characters such as éèà...
Product: [Applications] digikam Reporter: mahikeulbody
Component: Plugin-Generic-SendByMailAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: adrien.schvalberg, caulier.gilles, kde
Priority: NOR    
Version: 5.6.0   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In: 5.7.0

Description mahikeulbody 2009-04-18 17:44:54 UTC
Version:           0.10.0 (using 4.2.2 (KDE 4.2.2), Kubuntu packages)
Compiler:          cc
OS:                Linux (i686) release 2.6.28-11-generic

The images to email are located at: /home/michel/médiathèque/photo/
The path sent by Digikam to Evolution is /home/michel/mediathèque/photo/ so Evolution display an error message.
Comment 1 mahikeulbody 2009-04-18 18:01:34 UTC
May be Kipi-plugins 0.2.0-beta2 solves the bug:

SendImages : Complete re-write of emailing tool.
Comment 2 caulier.gilles 2009-04-18 18:24:49 UTC
Which kipi-plugin you use ?

Gilles Caulier
Comment 3 mahikeulbody 2009-04-18 18:45:38 UTC
(In reply to comment #2)
> Which kipi-plugin you use ?
> 
> Gilles Caulier

In fact I use 'Send Images - Kipi-plugins 0.2.0' so forget my previous comment...
Comment 4 Nicolas L. 2009-07-06 23:46:41 UTC
confirming in KMail with current trunk
Comment 5 Nicolas L. 2009-07-07 06:06:54 UTC
Is it ok to commit ?  for me this fixes the issue

Index: sendimages/sendimages.cpp
===================================================================
--- sendimages/sendimages.cpp   (révision 992427)
+++ sendimages/sendimages.cpp   (copie de travail)
@@ -389,7 +389,7 @@
                     for (KUrl::List::ConstIterator it = fileList.constBegin() ; it != fileList.constEnd() ; ++it )
                     {
                         args.append("-a");
-                        args.append(QFile::encodeName((*it).path()));
+                        args.append((*it).path());
                     }

                     if (!QProcess::startDetached(prog, args))
@@ -412,7 +412,7 @@
                     args.append("--attach");
                     for (KUrl::List::ConstIterator it = fileList.constBegin() ; it != fileList.constEnd() ; ++it )
                     {
-                        args.append(QFile::encodeName((*it).path()));
+                        args.append((*it).path());
                     }

                     QString prog;
@@ -442,7 +442,7 @@
                     for (KUrl::List::ConstIterator it = fileList.constBegin() ; it != fileList.constEnd() ; ++it )
                     {
                         tmp.append("&attach=");
-                        tmp.append( QFile::encodeName((*it).path()) );
+                        tmp.append( (*it).path() );
                     }
                     args.append(tmp);

@@ -464,7 +464,7 @@
                     for (KUrl::List::ConstIterator it = fileList.constBegin() ; it != fileList.constEnd() ; ++it )
                     {
                         args.append("--attach");
-                        args.append(QFile::encodeName((*it).path()));
+                        args.append((*it).path());
                     }

                     if (!QProcess::startDetached(prog, args))
Comment 6 Nicolas L. 2009-07-07 20:10:18 UTC
gilles what do you think of this patch ?
Comment 7 Nicolas L. 2009-07-07 20:13:09 UTC
*** Bug 158916 has been marked as a duplicate of this bug. ***
Comment 8 caulier.gilles 2009-07-07 20:13:31 UTC
The question is : why something like QFile::encodeName() do not exist to handle UTF-8 char encoding ?

http://doc.trolltech.com/4.5/qfile.html#encodeName

If you grep this method in kipi-plugins/digiKam/libkdcraw/libkexiv2, you will see that it's used everywhere to handle file name.

I remember some problem With qt3 to pass QString as well to handle file name. perhaps iy's obsolete now with QT4.

To resume, this will not limited to patch SendImages plugin in this way. If i remember, there are other bug report like this in Bugzilla...

Gilles Caulier
Comment 9 Nicolas L. 2009-07-07 23:53:51 UTC
but here this is KUrl that are used and they are already encoded as the API tells :

Constructor taking a char * urlOrPath, which is an _encoded_ representation of the URL, exactly like the usual constructor. 
This is useful when the URL, in its encoded form, is strictly ascii.
Comment 10 Nicolas L. 2009-07-10 07:53:55 UTC
SVN commit 994087 by nlecureuil:

SendImage: Add A warning when a file is too big to be sent
SendImage: Do not encode file name as KUrl already does this
BUG:146487
BUG:189984 


 M  +12 -6     sendimages.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=994087
Comment 11 caulier.gilles 2017-07-10 10:18:01 UTC
This problem is not reproducible with new Send By Mail tool from digiKam core
version 5.7.0.

Gilles Caulier