CVS commit by kalass: The Language String is constructed by 'language (charset)', but at least in the german translation language names might contain braces. That was done for simplified and traditional chinese. So we need to search the last pair of braces, not the first one. Set encoding was broken for most charsets and applications like konqueror and kwrite in revision 1.142, the intention back then was to strip whitespaces. This patch strips white spaces correctly and does not break the string handling when there are no white spaces. CCMAIL: 75567-done@bugs.kde.org M +7 -7 kcharsets.cpp 1.144.2.1 --- kdelibs/kdecore/kcharsets.cpp #1.144:1.144.2.1 @@ -498,17 +498,17 @@ QString KCharsets::languageForEncoding( QString KCharsets::encodingForName( const QString &descriptiveName ) { - const int left = descriptiveName.find( '(' ); + const int left = descriptiveName.findRev( '(' ); if (left<0) // No parenthesis, so assume it is a normal encoding name - return descriptiveName; + return descriptiveName.stripWhiteSpace(); - QString name(descriptiveName.mid(left+2)); + QString name(descriptiveName.mid(left+1)); - const int right = name.find( ')' ); + const int right = name.findRev( ')' ); if (right<0) return name; - return name.left(right-1); + return name.left(right).stripWhiteSpace(); }