[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: QString data
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2003-08-21 8:51:39
[Download RAW message or body]

On Wednesday 20 August 2003 18:16, Johnny Andersson wrote:
> On Wednesday 20 August 2003 17.58, Nicolas Goutte wrote:
> > To be clear: if you choose to have always a UCS2 big endian file, the
> > data that you would need to convert is only the word that has to be
> > searched. So it is similar to the QCString solution, but in this case Qt
> > helps you much less, as there is no pre-made class. (see Q_UINT16 as data
> > class and for writing the file, see: QDataStream::operator << and
> > QDataStream::setByteOrder)
>
> Hi again. I'm implementing the QCString solution right now, so far it seems
> like the best bet after all. It didn't occur to me that I could do
> comparison directly on two utf8 QCStrings, like you say. Which means, again
> like you say, that I only have to convert my search string to utf8. In my
> previous solution, I did string.fromUtf8() before every comparison - too
> slow. :)
>
> I'm not sure if it's "good" to compare to utf8 strings directly, but
> as japanese characters don't have upper and lower case, it's probably OK.

In any case, Qt on X-Window does not support locale-aware comparing. It is 
only available in Qt for Win32 (as it uses Windows to do it.)

> My only concern right now is if things like
> utf8cstring1.contains(utf8cstring2) will work...  Haven't tried it yet.

It should. Even if a character may be represented by a few bytes, the starting 
byte is unlike the others. So you cannot have partial (mis-)matches.
(See: http://www.ietf.org/rfc/rfc2279 )
>

Another interesting reference:
http://www.unicode.org/faq/utf_bom.html (FAQ about UTF and Byte Order Mark)

Have a nice day!

> >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to
> >> unsubscribe <<

 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic