[Kde-pim] Review Request 124928: Use toLocal8Bit/fromLocal8Bit for POSIX API

Daniel Vrátil dvratil at kde.org
Fri Aug 28 12:00:32 BST 2015



> On Aug. 26, 2015, 1:27 p.m., Daniel Vrátil wrote:
> > The patch looks good. Would maybe passing QString::fromLatin1(QFile::encodeName(socketFile)) to listen() workaround the QLocalServer problem temporarily?
> 
> Dāvis Mosāns wrote:
>     Can't do that because while it will correctly create a socket in correct folder, other applications such as PIM will fail to connect to it, they also would need such patching.
>     Better workaround is to just replace non-latin characters, only now folder will be with actual "?" for those characters but that's not really an issue unless there's 2 users where both would correspond to same latin representation.
> 
> Daniel Vrátil wrote:
>     Patching kdepimlibs is the simplest thing and we can do it very easily - way more easily than patching Qt and waiting for it to get shipped by downstreams :)
> 
> Dāvis Mosāns wrote:
>     Well, this workaround I added works too and that's only place where need it. If you think this isn't good then okay I can submit other patches.

But doesn't the code in client libraries need the same adjustment anyway? Or does QLocalSocket::connectToServer() handle the utf-8 socket path correctly?


- Daniel


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/124928/#review84402
-----------------------------------------------------------


On Aug. 27, 2015, 12:58 a.m., Dāvis Mosāns wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/124928/
> -----------------------------------------------------------
> 
> (Updated Aug. 27, 2015, 12:58 a.m.)
> 
> 
> Review request for Akonadi.
> 
> 
> Repository: akonadi
> 
> 
> Description
> -------
> 
> Use toLocal8Bit/fromLocal8Bit for POSIX API
> When user have non-latin username it would create folder /tmp/akonadi-* with wrong encoding.
> This fixes it by using fromLocal8Bit which will convert to QString from LANG encoding.
> 
> 
> Diffs
> -----
> 
>   src/server/akonadi.cpp a4f0e8cb88053d6a4c575f46fa9e521dee1a6402 
>   src/server/utils.cpp 1195cd7546ba7dd0637238c7d9371d454d1f5d06 
> 
> Diff: https://git.reviewboard.kde.org/r/124928/diff/
> 
> 
> Testing
> -------
> 
> Compiles and correctly created folder /tmp/akonadi-D?vis.FurEKd/ for username D?vis (PS. that "?" is messed up by reviewboard)
> Only it fails on listen(socketFile) because QLocalServer incorrectly uses toLatin1 for POSIX API.
> I created a patch for it https://codereview.qt-project.org/#/c/124230/
> 
> 
> Thanks,
> 
> Dāvis Mosāns
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list