This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
VERY Strange interaction between strcoll, Qt, and locale
- From: Albert Astals Cid <tsdgeos at terra dot es>
- To: libc-alpha at gnu dot org
- Date: Sat, 10 Jan 2004 02:23:09 +0100
- Subject: VERY Strange interaction between strcoll, Qt, and locale
Hi, i have been speaking with Trolltech people with what i though was a Qt
(their library) bug, but after both them and me looking at it, it seems it is
a very strange interaction between strcoll, Qt, and the current system
locale.
I send two attached programs.
Both are the same except test4 has a QApplication object and test3 has not.
Both use strcoll to compare the same strings.
Both give the same results with LC_ALL= en BUT if i set LC_ALL=es_ES test3 and
test4 give to me DIFFERENT results.
Any idea?
Thanks for any input on this.
Albert.
P.S: I'm not subscribed to the list, so please keep me CC'ed
P.S: If you are not familiar with Qt a typical line to compile a QT program is
gcc -o test4 test4.cpp -I $(QtIncludePath) -L $(QtLibPath) -lqt-mt
#include <qapplication.h>
#include <qstring.h>
int main(int argc, char *argv[])
{
printf("strcoll calls\n");
printf("unit.cpp unit.h %d\n", strcoll("unit.cpp", "unit.h"));
printf("unit.h unit.cpp %d\n", strcoll("unit.h", "unit.cpp"));
printf("unit.cpp unitdescriptor.cpp %d\n", strcoll("unit.cpp", "unitdescriptor.cpp"));
printf("unitdescriptor.cpp unit.cpp %d\n", strcoll("unitdescriptor.cpp", "unit.cpp"));
printf("unit.h unitdescriptor.cpp %d\n", strcoll("unit.h", "unitdescriptor.cpp"));
printf("unitdescriptor.cpp unit.h %d\n", strcoll("unitdescriptor.cpp", "unit.h"));
return 0;
}
#include <qapplication.h>
#include <qstring.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
printf("strcoll calls\n");
printf("unit.cpp unit.h %d\n", strcoll("unit.cpp", "unit.h"));
printf("unit.h unit.cpp %d\n", strcoll("unit.h", "unit.cpp"));
printf("unit.cpp unitdescriptor.cpp %d\n", strcoll("unit.cpp", "unitdescriptor.cpp"));
printf("unitdescriptor.cpp unit.cpp %d\n", strcoll("unitdescriptor.cpp", "unit.cpp"));
printf("unit.h unitdescriptor.cpp %d\n", strcoll("unit.h", "unitdescriptor.cpp"));
printf("unitdescriptor.cpp unit.h %d\n", strcoll("unitdescriptor.cpp", "unit.h"));
return 0;
}