[Issue N23835] [PATCH] Files with non-utf8 names unaccessible from Qt when using utf8 locale

Waldo Bastian bastian at kde.org
Fri Jul 4 10:58:11 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 04 July 2003 10:31, qt-bugs at trolltech.com wrote:
> You're right. One needs a solution to the problem you described. However
> I don't like using 0xfffd+QChar(ch) for mapping these characters to
> Unicode, as the forward and back transformations violate the utf8
> encoding a lot.
>
> I've implemented a slightly different solution mapping the characters to
> a surrogate pair in the supplementary private use area, as this should
> hopefully lead to less conflicts. The only disadvantage is that
> currently (until we have a better surrogate handling in Qt) each of
> these characters will show up as two boxes instead of one box and the
> char mapped from latin1. The diff against qt-3.2 beta2 is attached.

I don't think this is very bad, since the character may very well not be 
latin1 either anyway. Not using 0xfffd may give problems wrt compatibility 
though: currently a Qt application could check if a QString contains 0xfffd 
to decide whether the string used as input was valid utf8. I don't think 
QString provides another way to check if utf8 conversion was/will be 
successful.

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/BU+zN4pvrENfboIRAtQlAJ9UDS2SVjVeWf1zJ/IyId3Y03MdpQCePVI6
XeEkerxAwGATacO3vLQPq8U=
=V7hs
-----END PGP SIGNATURE-----




More information about the kde-core-devel mailing list