Encoding problem in the file ioslave
Michael Pyne
mpyne at purinchu.net
Sun Aug 31 23:43:12 BST 2008
On Sunday 31 August 2008, Albert Astals Cid wrote:
> Debugging a bit i've found that in KDE3 QFile::decodeName("C�digo") gives
> us a QString whose char unicode values are
> 67 255 243 100 105 103 111
> but in KDE 4 we get
> 67 253 100 105 103 111
>
> Any idea on how to solve that? It's a Qt bug? Or should we store the
> QByteArray of the path in UDSEntry without converting to QString?
First question I think is, what is the locale that you are operating in
(judging by the QFile docs I would assume that decodeName uses
QString::local8Bit() or better yet the appropriate QLocaleCodec equivalent).
So if the two decoded strings are really different for the same locale there's
probably a Qt bug in there somewhere.
As far as QByteArray vs. QString I think it depends on the destination of the
value in the UDSEntry. If it's to be used later in opening the file it would
probably be safest to keep the exact same string as returned from the OS and
convert when showing to the user or whenever else the program requests the
QString.
*But*, remembering the network-transparent aspect to KIO we have to have a
system that is locale-independent to pass around filenames (we use QString in
this case) so based on that, I don't think converting the storage in UDSEntry
is the answer.
Regards,
- Michael Pyne
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080831/34f6d5f8/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080831/34f6d5f8/attachment.sig>
More information about the kde-core-devel
mailing list