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

Thiago Macieira thiagom at wanadoo.fr
Fri Jul 4 11:21:54 BST 2003


Waldo Bastian wrote:
>> 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.

This may solve only half of our problems.

The decodeFilename call is supposed to convert a given 8-bit character 
sequence into a unique Unicode representation, so that it can be used for 
displaying in widgets and titlebars. It's also necessary that this encoding, 
whatever it may be, gets us the original 8-bit character sequence when doing 
encodeFilename.

That is, apparently, solved.

However, the second part of the problem is what I'm worried about: I need to 
specify the encoding to be tried for the original string. And the attached 
patch deals with UTF-8 only, but some other encodings might fail as well. My 
situation is that of bug #56197, in which we have to try different encodings 
given the user's selection in a menu.

-- 
  Thiago Macieira  -  Registered Linux user #65028
   thiagom at mail.com           
    ICQ UIN: 1967141   PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030704/f7ba1f23/attachment.sig>


More information about the kde-core-devel mailing list