[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [Bug 75567] Set encoding does not work
From:       Klas Kalass <klas.kalass () gmx ! de>
Date:       2004-03-12 9:18:07
Message-ID: 20040312091807.8308.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
      
http://bugs.kde.org/show_bug.cgi?id=75567      
klas.kalass gmx de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From klas.kalass gmx de  2004-03-12 10:18 -------
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();
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic