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

List:       kde-commits
Subject:    branches/KDE/4.1/kdelibs/kdecore
From:       David Faure <faure () kde ! org>
Date:       2009-01-05 13:18:01
Message-ID: 1231161481.895354.22171.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 906060 by dfaure:

Backport SVN commit 906059:
Fix short/ushort error which broke prettyUrl for e.g. chinese unicode characters.


 M  +1 -1      io/kurl.cpp  
 M  +4 -0      tests/kurltest.cpp  


--- branches/KDE/4.1/kdelibs/kdecore/io/kurl.cpp #906059:906060
@@ -1006,7 +1006,7 @@
   QString result;
   for (int i = 0; i < input.length(); ++i) {
     QChar c = input.at(i);
-    register short u = c.unicode();
+    register ushort u = c.unicode();
     if (u < 0x20 || u == '?' || u == '#' || u == '%'
         || (u == ' ' && (i+1 == input.length() || input.at(i+1) == ' '))) {
       static const char hexdigits[] = "0123456789ABCDEF";
--- branches/KDE/4.1/kdelibs/kdecore/tests/kurltest.cpp #906059:906060
@@ -1507,6 +1507,10 @@
 
   KUrl umlaut2("http://www.clever-tanken.de/liste.asp?ort=N%FCrnberg&typ=Diesel"); // was ,106
   QCOMPARE(umlaut2.url(), QString("http://www.clever-tanken.de/liste.asp?ort=N%FCrnberg&typ=Diesel"));
+
+  KUrl wkai(QString::fromUtf8("/tmp/魔"));
+  QCOMPARE(wkai.url(), QString("file:///tmp/%E9%AD%94"));
+  QCOMPARE(wkai.prettyUrl(), QString::fromUtf8("file:///tmp/魔"));
 }
 
 void KUrlTest::testOtherEncodings()
[prev in list] [next in list] [prev in thread] [next in thread] 

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