Review Request 120131: Fix encoding issue in places dialog.
David Faure
faure at kde.org
Wed Sep 10 22:13:41 UTC 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120131/#review66197
-----------------------------------------------------------
Ship it!
Huh, this code went through a lot of history.
KDE3:
return KUrl(element.attribute("href"), 106); // Decode it from utf8 (106 is mib enum for utf8)
Ported to KDE4 (where mib enums disappeared) as:
return KUrl(element.attribute("href")); // Decodes it from utf8
Changed in 2008 to use the KUrl(QByteArray) ctor to avoid double-encoding (not sure why) :
return KUrl(element.attribute("href").toAscii()); // Decodes it from utf8
Ported to KF5 (by me) as:
return QUrl(element.attribute("href").toLatin1());
But indeed QUrl takes a QString, not a QByteArray, so that was a porting error. Your code is much more correct for sure.
- David Faure
On Sept. 10, 2014, 8:07 p.m., Maarten De Meyer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120131/
> -----------------------------------------------------------
>
> (Updated Sept. 10, 2014, 8:07 p.m.)
>
>
> Review request for KDE Frameworks and David Faure.
>
>
> Bugs: 337642
> https://bugs.kde.org/show_bug.cgi?id=337642
>
>
> Repository: kbookmarks
>
>
> Description
> -------
>
> toLatin1 gives encoding issues in KIO placesview. Example from the bug report is "Romário" -> "Rom?rio"
> I'm not sure if this is the correct solution? Why did this work in the past? And why was the cast to ascii and latin1 needed?
>
>
> Diffs
> -----
>
> src/kbookmark.cpp 9543120
>
> Diff: https://git.reviewboard.kde.org/r/120131/diff/
>
>
> Testing
> -------
>
> Tested with placesview from kwrite and dolphin.
> Any other code where kbookmarks is used that I should check for regressions?
>
>
> Thanks,
>
> Maarten De Meyer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20140910/af9f1526/attachment.html>
More information about the Kde-frameworks-devel
mailing list