6 ms·
QString::toUpper/toLower are not locale-aware (https://doc.qt.io/qt-6/qstring.html#toLower https://doc.qt.io/qt-6/qstring.html#toLower) Qt does have a locale-a
by cannam 2y ago
QString::toUpper/toLower are not locale-aware (https://doc.qt.io/qt-6/qstring.html#toLower https://doc.qt.io/qt-6/qstring.html#toLower)
Qt does have a locale-aware equivalent (QLocale::toUpper/toLower) which calls out to ICU if available. Otherwise it falls back to the QString functions, so you have to be confident about how your build is configured. Whether it works or not has very little to do with the design of QString.
- ahartmetz 2y agoI don't see a problem with that. You can have it done locale-aware or not and "not" seems like a sane default. QString will uppercase 'ü' to 'Ü' just fine without locale-awareness whereas std::string doesn't handle non-ASCII according to the article. The cases where locale matters are probably very rare and the result will probably be reasonable anyway.
- account42 2y agoThat attitude is how you end up with exploits because your case folding is different from some other system you interact with.