Problem with encodings in several places in KDE
Waldo Bastian
bastian at kde.org
Mon Nov 17 18:14:42 GMT 2003
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Mon November 17 2003 18:30, Thiago Macieira wrote:
> Hello everyone,
>
> I'm going to rehash a couple of situations that arise or have arisen in KDE
> regarding character encodings. I have thought of a solution, which involves
> TT adding a couple of methods to QString and QCString, but, before I send
> an e-mail to qt-bugs@, I'd like to have some feedback.
Keep in mind that N23835 fixes (part of) the problem now, your proposal will
not be available before Qt 4.
> For instance, Kopete relies on the decoding of the UTF-8 message to
> determine if it was properly encoded (see BR 67727).
That's easily fixed by using KStringHandler::isUtf8(const char *)
> Next, (and here's what I am proposing to TT) is that both QString and
> QCString hold a QTextCodec* pointer to the codec that can be used to
> convert the string back to its original form. QFile::encodeName and decode
> would be a special QTextCodec in this regard and they have to work for
> every encoding, not just UTF-8. One solution would be to break the filename
> into its components and encode each one separately; if any fail, the same
> "broken UTF-8" decoding of the current solution can be applied.
??? You want to register the encoding for each of the segments and keep them
around, even under transformation?
> For the problem Issue N23835 was the solution of, KDE code has to make sure
> that the codec value is kept alongside the QString internally -- that is,
> to be sure that the QString represents a filename. That way, when
> reencoding back to its 8-bit form in order to (for instance) rename the
> file, the original 8-bit value is restored. In order to launch an
> application, we end up with Bug #65378, which means the codec value would
> have to be transmitted through the DCOP stream (easiest solution: include
> it in the QString's marshalling format).
Keeping codecs around in the QString would indeed be nice, yes. Changes in
marshall format would break KDE4 - KDE3 wire compatibility though. Then
again, if we just drop that requirement, the migration to D-BUS will become a
lot easier.
Cheers,
Waldo
- --
bastian at kde.org -=|[ SUSE, The Linux Desktop Experts ]|=- bastian at suse.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE/uRATN4pvrENfboIRAqnQAKCOrK+ubA6nnRS7ry3sTYXgQTRz4wCghIF6
bs6pfrBgutl4Tnw9nwr8xcg=
=scWt
-----END PGP SIGNATURE-----
More information about the kde-core-devel
mailing list