[Development] The life of a file name and other possibly mal-encoded strings on non-Windows systems

Thiago Macieira thiago.macieira at intel.com
Wed Oct 8 08:03:39 CEST 2014


On Tuesday 07 October 2014 23:31:11 Christoph Feck wrote:
> On Tuesday 07 October 2014 23:19:23 Tony Van Eerd wrote:
> > > The problem is serious enough, indeed, that Python 3 has resorted
> > > to a hack where they use a private Unicode range to encode the
> > > bytes between 128 and 255 in strings that fail normal decoding.
> > > I think that putting this hack into QString is unthinkable, and
> > > the concept of a platform string has to be taken with heads up
> > > and in a manner that will make it useful, usable and
> > > unobtrusive. I don't claim that it's a trivial task, but then
> > > I'm not asking anyone else but myself to deal with it :)
> > > 
> > > Cheers, Kuba
> > 
> > I think that hack should be given serious consideration.  Sure it
> > is a hack, but it might still be the best solution.
> 
> We are using the same hack in KDE4Libs, but it relies on
> QFile::setDecodingFunction. Unfortunately, this function is no longer
> available in Qt5, so in a few years, we will see the same long
> discussion as in https://bugs.kde.org/show_bug.cgi?id=165044

That was done because from Qt 3 to early Qt 4, that's exactly what we did: the 
UTF-8 decoder used private-use characters to notify that it had bad decodings.

Python's solution is a copy of Qt's.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list