solid i18n krazy2 patch

Pino Toscano toscano.pino at tiscali.it
Fri Jan 23 15:39:01 GMT 2009


Alle venerdì 23 gennaio 2009, Christian Ehrlicher ha scritto:
> Dominik Haumann schrieb:
> > On Saturday 17 January 2009, Armin Moradi wrote:
> >> Attached is some fixes for the i18n problems which krazy2 (from EBN)
> >> has detected.
> >>
> >> This patch includes fixes for "passing QString() to endsWith() and
> >> startsWith()" problems.
> >
> > Before your patch, the strings are implicitely converted to a QString,
> > which is exactly the same as what your patch does now :) The right fix
> > (if there is need for a 'fix' at all) would be to use QLatin1String, just
> > like Stefan mentioned already.
> >
> > What does krazy exactly say as warning? I wonder because such patches
> > with QString wrappers appear on lots of our mailing lists and they don't
> > bring any performance boost. It's simply less readable :)
>
> krazy says they should use QLatin1String() instead - so the patch is wrong.
> The idea behind this is to avoid the QTextCodec conversion from locale
> encoding (which can be different on every machine but is mostly utf-8 on
> linux) to Unicode and use the fast QString::fromLatin1() function instead.

Which QTextCodec conversion? QString("foo") assumes the string is ASCII.

-- 
Pino Toscano
-------------- 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/20090123/53abed5c/attachment.sig>


More information about the kde-core-devel mailing list