<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/110043/">http://git.reviewboard.kde.org/r/110043/</a>
</td>
</tr>
</table>
<br />
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Independently from this patch, I was thinking of a completely different approach to solve non-utf8 encodings in file:/// urls: using KRemoteEncoding in kio_file, just like we do in other slaves like kio_ftp. I.e. letting the user select the encoding by hand for the current directory. This way, not only would files be usable, but they could even appear correctly. However it requires manual user intervention, but that's the case anyway for FTP dirs that use another locale etc.
On the other hand it moves the fix "up to KIO", so it wouldn't work for other QFile uses.. [hmm, or anywhere where KIO has a fast path for local files to avoid calling kio_file.... Ouch, that might kill this idea completely, in fact]. Well, food for thought, then.</pre>
<br />
<p>- David</p>
<br />
<p>On June 28th, 2013, 9:28 a.m. UTC, Róbert Szókovács wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for kdelibs and Thiago Macieira.</div>
<div>By Róbert Szókovács.</div>
<p style="color: grey;"><i>Updated June 28, 2013, 9:28 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This patch works around the problem of filenames that are not valid UTF8 strings: in KLocalePrivate::initFileNameEncoding() KDE sets the QFile's encoding/decoding function, to to/fromUTF8() in QString, which in turn calls QUtf8's converter function (QUtf8 is not exported to developers, so I had to use an inefficient method, I think it would be better if we could use the state parameter for error detection). I replaced this with the said functions' copy/pasted version and changed it, so when it encounters an invalid UTF8 string, it will encode it byte by byte, mapping the lower 128 their normal unicode place and the upper 128 to U+18000-U+1807F, and of course the decoder reverses it.
To make this actually work you have to define the KDE_UTF8_FILENAMES enviroment variable to a specific value ("broken_names").
To test it, do the following: .kde/env/KDE_UTF8_FILENAMES.sh with this content:
export KDE_UTF8_FILENAMES=broken_names
logout, login, try dolphin on faulty files. (instead of the usual boxed "?" you'll see just boxes)</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="http://bugs.kde.org/show_bug.cgi?id=165044">165044</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kdecore/localization/klocale_kde.cpp <span style="color: grey">(b010e74)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/110043/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>