Review Request 110043: Proposed fix/workaround for legacy encoded filename handling

Róbert Szókovács szo at szo.hu
Wed May 1 12:00:01 BST 2013



> On April 16, 2013, 5:15 p.m., Christoph Feck wrote:
> > Nice idea, would be better to use Unicode Private Use Areas instead of 0x18000 codes.

I've been considering that, too. I don't think it's very likely that someone will legitimely use neither the PUA or any currently unassigned area for filenames (which would cause problem, of course), so it really up to discussion. I don't have commit right, so ultimately it's up to someone who has and willing to sponsor/commit this fix, I have no real preference. I picked this area because I had to pick something and currently no-one can or should use it, but the PUA can be in private use.


- Róbert


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/110043/#review31172
-----------------------------------------------------------


On April 16, 2013, 2:59 p.m., Róbert Szókovács wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/110043/
> -----------------------------------------------------------
> 
> (Updated April 16, 2013, 2:59 p.m.)
> 
> 
> Review request for kdelibs.
> 
> 
> Description
> -------
> 
> 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)
> 
> 
> This addresses bug 165044.
>     http://bugs.kde.org/show_bug.cgi?id=165044
> 
> 
> Diffs
> -----
> 
>   kdecore/localization/klocale_kde.cpp b010e74 
> 
> Diff: http://git.reviewboard.kde.org/r/110043/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Róbert Szókovács
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20130501/1dab97ac/attachment.htm>


More information about the kde-core-devel mailing list