solid i18n krazy2 patch

Olivier Goffart ogoffart at kde.org
Sat Jan 24 11:05:28 GMT 2009


Le vendredi 23 janvier 2009, Stefan Majewsky a écrit :
> On Samstag 17 Januar 2009 22:38:09 Armin Moradi wrote:
> > This patch includes fixes for "passing QString() to endsWith() and
> > startsWith()" problems.
>
> I learned that it is better to instantiate such string constants through
> the QLatin1String constructor, 

Yes this is correct.

> because that bypasses the complex UTF-8 parsing. Can anyone confirm this?

But this is not the reason.

QString(const char*) constructor doesn't do utf8 parsing, it suppose the 
string is latin1 (by default)  and convert it to utf-16.

QLatin1String may avoid a conversion to utf16 in some cases (comparison with 
string, ....)

And startWith and endsWith have overload for QLatin1String that are faster 
than first converting to QString.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090124/f6bdf62e/attachment.sig>


More information about the kde-core-devel mailing list