Bug#612675: Re[2]: Bug#612675: libkio5: KTar class have broken UTF-8 support(longlink)

2011-05-13 Thread Modestas Vainius
Hello,

On pirmadienis 09 Gegužė 2011 13:24:51 Ibragimov Rinat wrote:
> > > Can you point to some of those checks? I've looked through the code
> > > again and found nothing related to QString. There are only some of
> > > them related to QByteArray.
> > 
> > But why do you think QByteArray checks are not affected?
> 
> Because QByteArray is intended to store raw bytes [1],

Basically, QByteArray is a wrapper class on top of char*. For example, 
QString::toUtf8() returns QByteArray as well.

> while QString stores
> charactes which may be wider than 8-bit. Current implementation uses 16-bit
> QChars [2].

Well, ok, but that still does not explain why you cast one "check" to 
(unsigned char) leaving others untouched. QByteArray::operator[] also returns 
a _signed_ char. So what makes you think those chars will always be <= 127 ?

-- 
Modestas Vainius 


signature.asc
Description: This is a digitally signed message part.


Bug#612675: Re[2]: Bug#612675: libkio5: KTar class have broken UTF-8 support(longlink)

2011-05-09 Thread Ibragimov Rinat
> > Can you point to some of those checks? I've looked through the code again
> > and found nothing related to QString. There are only some of them related
> > to QByteArray.
> 
> But why do you think QByteArray checks are not affected?

Because QByteArray is intended to store raw bytes [1], while QString stores
charactes which may be wider than 8-bit. Current implementation uses 16-bit
QChars [2].

[1] http://doc.qt.nokia.com/4.6/qbytearray.html#details
[2] http://doc.qt.nokia.com/4.6/qstring.html#details