QString latin1 comparision

Juergen Pfennig info at j-pfennig.de
Sun Oct 17 18:31:30 BST 2004

On Saturday 16 October 2004 13:15, Stephan Kulow wrote:
> Am Samstag 16 Oktober 2004 11:07 schrieb Benjamin Meyer:
> > From http://lists.kde.org/?l=kde-core-devel&m=107918336006593&w=2 I have
> > written a script (for the kde automated testing) that finds all cases of
> > it such as:
> >
> > Checking: kdebase
> > table.setSelected(i/3,args[i+2]==QString::fromLatin1("on"));
> > table.setSelected(i/3,args[i+2]==QString::fromLatin1("on"));
> > ./kdialog/widgets.cpp
> >
> > Now after reading the whole thread I am unsure what to do.  Do I remove
> > them in everything or everything but kdelibs or ?
> No. we want these fromLatin1 to find the places where the encoding is
> assumed. We should have more of NO_ASCI_CAST instead of less
> Greetings, Stephan

Hello Stephan,

I would understand if you would say you want some no-op macro to flag such a 
situation or use the macro that comes with qt4 (or a dummy for that). But 
QString::fromLatin1() is not a no-op and it is unefficient because it creates 
a temporary QString object.

KDE is slow enough and has more than enough bugs. Why trying to make it 
slower? Please have a look at win2003 and compare the speed to KDE! QT is not 
stupid and today the NO_ASCI_CAST makes little sense, as QT has overloaded 
Latin1 functions almost everywhere.

Assuming that you wanted to flag possible char-set problems with non-us-ascii 
chars I come to another question: GNU GCC still does not support  "wide" 
string literals (right?). Like: L"This is UNICODE" . So there are two other 

(1) using UTF-8 strings everywhere instead of us-ascii (does gcc like this?)

(2) moving away from GCC - here: supporting UNICODE string literals.

Moving away from GCC (by using a pre-processor?) could help to cure another 
extremely ugly KDE problem:

--- The broken exception handling in C++ (is it really broken?)

I am sure that the introduction of a general exception handling mechanism 
could increase the quality of KDE.

Yours J├╝rgen

More information about the kde-core-devel mailing list