+2007-10-03 Lars Knoll <lars@trolltech.com>
+
+ Reviewed by Rob.
+
+ Fix a stupid bug in Unicode::toUpper/toLower.
+ Fixes all three test failures in the JavaScriptCore test
+ suite.
+
+ * wtf/unicode/qt4/UnicodeQt4.h:
+ (WTF::Unicode::toLower):
+ (WTF::Unicode::toUpper):
+
2007-10-02 Darin Adler <darin@apple.com>
Reviewed by Adam.
#if QT_VERSION >= 0x040300
// FIXME: handle surrogates correctly in all methods
-
+
inline UChar32 toLower(UChar32 ch)
{
return QChar::toLower(ch);
const UChar *s = src;
UChar *r = result;
UChar *re = result + resultLength;
-
+
// this avoids one out of bounds check in the loop
- if (QChar(*s).isLowSurrogate())
+ if (QChar(*s).isLowSurrogate())
*r++ = *s++;
int needed = 0;
const QUnicodeTables::Properties *prop = QUnicodeTables::properties(c);
if (prop->lowerCaseSpecial) {
QString qstring;
- if (c > 0x10000) {
+ if (c < 0x10000) {
qstring += QChar(c);
} else {
qstring += QChar(*(s-1));
const UChar *s = src;
UChar *r = result;
UChar *re = result + resultLength;
-
+
// this avoids one out of bounds check in the loop
- if (QChar(*s).isLowSurrogate())
+ if (QChar(*s).isLowSurrogate())
*r++ = *s++;
int needed = 0;
const QUnicodeTables::Properties *prop = QUnicodeTables::properties(c);
if (prop->upperCaseSpecial) {
QString qstring;
- if (c > 0x10000) {
+ if (c < 0x10000) {
qstring += QChar(c);
} else {
qstring += QChar(*(s-1));
{
return (CharCategory) U_MASK(QChar::category(c));
}
-
+
#else
inline UChar32 toLower(UChar32 ch)
}
#endif
-
+
}
}