KURIFilter: Google shortcut fails with umlauts

Malte Starostik malte at kde.org
Fri Sep 19 00:11:34 BST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I can't tell when it first happened, I only noticed this today. My default 
charset is latin1 while the google web shortcut uses utf-8.
When typing "gg:ümläüts" into minicli or konq's location bar, this results in 
an incorrect query string: the query contains "ümläüts" in URL-encoded 
latin1, but the encoding parameter included in the query string says it's 
utf-8.
When entering the above shortcut into the location bar/minicli, it's converted 
to a KURL using my locale's default encoding (latin1), but the web shortcut 
plugin decodes this URL using the charset specified in the 
shortcut's .desktop file (utf-8).
Of course I could change the charset to latin1, but that would mean I'd also 
have to change the URL passed to google to indicate this and cannot any 
longer use the default google.desktop file.
IMHO the direct problem here is that the web shortcut filter uses the same 
codec when decoding the user input string as well as when encoding the 
filtered URL.
The attached patches fix the above problem for me. It's not complete though, 
e.g. the shorturi filter uses KURL::decode_string() with no encoding hint, so 
I guess it might fail there; the auto web filter doesn't seem to handle 
encodings at all from a short look.
Did I miss anything else? Any other suggestions?
BTW: is there something simpler (faster?) than 
QTextCodec::codecForName( "utf8" )->mibEnum()? Is it safe to hard-code 106?

Regards,
- -Malte
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/ajupVDF3RdLzx4cRAp4fAKCbBP0LhB4Of70RpM0yAa/UZt1lxACgs3cm
lqLCJVCsmB/+oNr51WY2J/M=
=EtI6
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdebase-kcontrol-ebrowsing-plugins-ikws.diff
Type: text/x-diff
Size: 700 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20030919/0df0336b/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdelibs-kio-kio.diff
Type: text/x-diff
Size: 818 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20030919/0df0336b/attachment-0001.diff>


More information about the kfm-devel mailing list