Bug 64304 - google search protocol's uri(gg:???) charset isn't UTF-8
Summary: google search protocol's uri(gg:???) charset isn't UTF-8
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
: 73229 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-15 10:13 UTC by Takumi ASAKI
Modified: 2004-01-22 17:42 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kuriifilt.diff (2.63 KB, text/x-diff)
2003-12-13 10:37 UTC, David Faure
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Takumi ASAKI 2003-09-15 10:13:28 UTC
Version:            (using KDE 3.1.9)
Compiler:          gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice)
OS:          Linux (i686) release 2.4.20-gentoo-r5

I tried to use google search uri(gg:???) in Japanese.

But, uri encoded in EUC-JP, not UTF-8.
http://www.google.com/search?q=%C6%FC%CB%DC%B8%EC&ie=UTF-8&oe=UTF-8

So, search failed.
Comment 1 George Staikos 2003-09-22 19:52:39 UTC
I believe this was fixed in CVS.  Please verify. 
Comment 2 Thiago Macieira 2003-09-23 03:25:56 UTC
When was this fixed? My build (20030916) has this problem. It's using the local 8 bit encoding instead 
of UTF-8. 
Comment 3 George Staikos 2003-09-25 11:51:00 UTC
The day before I posted that comment it was fixed by Malte I believe. 
Comment 4 Takumi ASAKI 2003-09-25 13:12:11 UTC
I tested CVS(20030921). 
It's fixed. 
Comment 5 Takumi ASAKI 2003-12-13 05:34:50 UTC
CVS-HEAD(20031206) has this bug again.

Google search uri(gg:...) sends local coding(EUC-JP) insted of UTF-8.
So. Google Search failed.
Comment 6 David Faure 2003-12-13 10:37:58 UTC
Subject: Re:  google search protocol's uri(gg:???) charset isn't UTF-8

On Saturday 13 December 2003 05:34, you wrote:
> Google search uri(gg:...) sends local coding(EUC-JP) insted of UTF-8.
> So. Google Search failed.

Indeed, the "fix" for this bug was wrong, it broke other things, so it had to be reverted
(see discussions on kde-core-devel).

I think the real fix for this is in the ikws filter itself.
Does the attached patch help? I can't easily test it myself.



Created an attachment (id=3675)
kuriifilt.diff
Comment 7 Takumi ASAKI 2003-12-14 23:35:15 UTC
Thanks.

Google Search url(gg:...) works well by your patch.
It sends encoded UTF-8 strings.
Comment 8 David Faure 2003-12-15 16:41:10 UTC
Subject: kdebase/kcontrol/ebrowsing/plugins/ikws

CVS commit by faure: 

Fixed encoding of ikws query, okayed by Dawit.
CCMAIL: 64304-done@bugs.kde.org


  M +3 -4      kuriikwsfiltereng.cpp   1.38
  M +1 -1      kuriikwsfiltereng.h   1.14
  M +2 -2      kurisearchfilter.cpp   1.13


--- kdebase/kcontrol/ebrowsing/plugins/ikws/kuriikwsfiltereng.cpp  #1.37:1.38
@@ -53,5 +53,5 @@ KURISearchFilterEngine::KURISearchFilter
 }
 
-QString KURISearchFilterEngine::webShortcutQuery( const KURL &url ) const
+QString KURISearchFilterEngine::webShortcutQuery( const QString& typedString ) const
 {
   QString result;
@@ -60,5 +60,5 @@ QString KURISearchFilterEngine::webShort
   {
     QString key;
-    QString search = url.url();
+    QString search = typedString;
     int pos = search.find(m_cKeywordDelimiter);
 
@@ -73,6 +73,5 @@ QString KURISearchFilterEngine::webShort
       {
         result = formatResult(provider->query(), provider->charset(),
-                              QString::null, search.mid(pos+1),
-                              !url.isValid());
+                              QString::null, search.mid(pos+1), true);
         delete provider;
       }

--- kdebase/kcontrol/ebrowsing/plugins/ikws/kuriikwsfiltereng.h  #1.13:1.14
@@ -46,5 +46,5 @@ public:
   QCString name() const;
   
-  QString webShortcutQuery (const KURL&) const;
+  QString webShortcutQuery (const QString&) const;
   
   QString autoWebSearchQuery (const KURL&) const;

--- kdebase/kcontrol/ebrowsing/plugins/ikws/kurisearchfilter.cpp  #1.12:1.13
@@ -54,7 +54,7 @@ bool KURISearchFilter::filterURI( KURIFi
 {
   if ( KURISearchFilterEngine::self()->verbose() )
-    kdDebug() << "KURISearchFilter::filterURI: " << data.uri().url() << endl;
+    kdDebug() << "KURISearchFilter::filterURI: " << data.typedString() << endl;
 
-  QString result = KURISearchFilterEngine::self()->webShortcutQuery( data.uri() );
+  QString result = KURISearchFilterEngine::self()->webShortcutQuery( data.typedString() );
 
   if ( !result.isEmpty() )


Comment 9 Thiago Macieira 2004-01-22 17:42:29 UTC
*** Bug 73229 has been marked as a duplicate of this bug. ***