Bug 128842

Summary: New slashdot is broken with Turkish locale
Product: [Applications] konqueror Reporter: Ismail Donmez <ismail>
Component: khtml ecmaAssignee: Konqueror Developers <konq-bugs>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:

Description Ismail Donmez 2006-06-08 18:11:17 UTC
Version:            (using KDE KDE 3.5.3)
Installed from:    Unlisted Binary Package
OS:                Linux

Open a konsole,

LC_ALL=tr_TR konqueror

and notice that sidebar on the left does not collapse.

Now try,

LC_ALL=C konqueror

and sidebar collapses correctly, and you see the menu artifact now too.
Comment 1 Ismail Donmez 2006-06-08 20:32:01 UTC
Logs with KJS_VERBOSE :

http://cekirdek.pardus.org.tr/~ismail/tmp/kjs_tr.txt (LC_ALL=tr_TR)
http://cekirdek.pardus.org.tr/~ismail/tmp/kjs_C.txt (LC_ALL=C)
Comment 2 David Faure 2006-06-08 23:12:04 UTC
SVN commit 549506 by dfaure:

Fix /. for Turkish users: use locale-independent toupper and tolower replacements.
BUG:128842


 M  +6 -4      ustring.cpp  


--- branches/KDE/3.5/kdelibs/kjs/ustring.cpp #549505:549506
@@ -131,18 +131,20 @@
 UChar UChar::toLower() const
 {
   // ### properly support unicode tolower
-  if (uc >= 256 || islower(uc))
+  if (uc >= 256)
     return *this;
 
-  return (unsigned char)tolower(uc);
+  // tolower is locale-dependent, don't use it.
+  return static_cast<unsigned char>( ( ( uc >= 'A' ) && ( uc <= 'Z' ) ) ? ( (int)uc + 'a' - 'A' ) : uc );
 }
 
 UChar UChar::toUpper() const
 {
-  if (uc >= 256 || isupper(uc))
+  if (uc >= 256)
     return *this;
 
-  return (unsigned char)toupper(uc);
+  // toupper is locale-dependent, don't use it.
+  return static_cast<unsigned char>( ( ( uc >= 'a' ) && ( uc <= 'z' ) ) ? ( (int)uc + 'A' - 'a' ) : uc );
 }
 
 UCharReference& UCharReference::operator=(UChar c)