Hi all,<br>
I made two experiments:<br>the first program is:<br>#include <QCoreApplication><br>#include <QFile><br>#include <stdio.h><br>int main(int argc, char *argv[])<br>{<br> QCoreApplication app(argc, argv);<br> printf("%s\n", QFile::encodeName(QString::fromUtf8("/home/ΕΛ")).data());<br> return 0; <br>}<br>the output is: <br>/home/ΕΛ<br><br>the second program is:<br>#include <QCoreApplication><br>#include <QFile><br>#include <stdio.h><br>int main(int argc, char *argv[])<br>{<br> //QCoreApplication app(argc, argv);<br> printf("%s\n", QFile::encodeName(QString::fromUtf8("/home/ΕΛ")).data());<br> return 0; <br>}<br>the out
put is: <br>/home/<br><br>QFile::encodeName got wrong file name without a QCoreApplication object !<br>(my locale is zh_CN.UTF-8)<br>
<br>From the error messages:<br>"<br>trying to create local folder /home/.kde: Permission denied<br>trying to create local folder /home/.kde: Permission denied<br>Link points to "/tmp/ksocket-ΕΛ"<br>trying to create local folder /home/.kde: Permission denied<br>kdeinit4: Aborting. bind() failed: : No such file or directory<br>Could not bind to socket '/home/.kde/socket-localhost.localdomain/kdeinit4__0'<br>"<br>I find that maybe something is wrong when binding a socket.<br><br>kdelibs/kinit/kinit.cpp<br>main() function calls kdeinit_library_path() function.<br>1808 kdeinit_library_path();<br><br>and in kdeinit_library_path() function,<br>1562 QByteArray socketName = QFile::encodeName(KStandardDirs::locateLocal("socket", QString("kdeinit4_%1").a &nbs
p; rg(QLatin1String(display)), *s_instance));<br><br>I think that's the reason why kdeinit4 binds the socket wrongly,<br>and we should add a QCoreAoolication to make QFile, QDir
and other QT class work in kdeinit4.<br><br>Best regards!<br><br>pwp<br>