yubnub search tools & korean encoding issue

3 views
Skip to first unread message

HopfZ

unread,
Sep 9, 2006, 4:56:27 AM9/9/06
to YubNub
I've tested using korean language in several yubnub tools (yubnub
homepage, searchbox, bookmarklets) and here's the result.

I tested with two machines :
XPEng is a machine with English Windows XP SP2, East Asian language
installed, Korean as language for non-Unicode programs.
XPKor is a machine with Korean Windows XP SP2.

I did it with five browsers :
English Opera, English Firefox and English IE on the machine XPEng.
Let's say they are OpEng, FxEng and IeEng.
Korean Opera and Korean IE on the machine XPKor. Let's say they are
OpKor and IeKor.

I checked five tools :

* Yubnub Homepage
http://yubnub.org

* Yubnub Firefox Search plug-in,
which can be found in
http://mycroft.mozdev.org/download.html?name=yubnub&sherlock=yes&submitform=Search

* Yubnub Opera Search plug-in,
which can be found in 'Opera Integration' section in
http://yubnub.org/documentation/describe_installation

* Yubnub bookmarklet,
which is in
http://yubnub.blogspot.com/2005/11/yubnub-bookmarklet-by-brian-armknecht.html

this bookmarklet uses javascript escape function to parse
search-queries.
But encodeURIComponent function is replacing escape function.
I made another bookmarklet that uses encodeURIComponent.


1. Yubnub Homepage

My test search queries are these two:
naver AIR
g AIR
,where the capital AIR part is replaced with the Korean word that means
air in English.
When I tested these queries on yubnub homepage from IeKor and OpKor,
yubnub redirected to correct pages. i.e. no encoding error occured.
But from OpEng, FxEng and IeEng, the 'g AIR' query was incorrectly
handled. the 'naver AIR' query was correctly handled.


2. Yubnub Firefox Search plug-in

When I entered those two queries in Yubnub Firefox search plug-in on
FxEng, the things were reversed, the naver query was incorrectly
handled while the g query was correctly handled.


3. Yubnub Opera Search plug-in

Opera plug-in on OpEng and on OpKor both incorrectly handled the two
queries.


4. Yubnub bookmarklet (escape)

For bookmarklets cases, the test queries are these two:
naver AIR BOOK
g AIR BOOK
, where the capical BOOK part is replaced with the Korean word that
means book in English.
To test 'g AIR BOOK', I first went to the naver homepage
(http://www.naver.com) and selected the Korean word BOOK, and then
clicked the bookmarklet to enter 'g AIR' to the promptbox, then the
bookmarklet should send the query 'g AIR BOOK' to the yubnub server.
What it really does is :
location="http://yubnub.org/parser/parse?command=" +
escape(p).replace(/ /g, "+") + " " + escape(q).replace(/ /g, "+");
, where p == 'g AIR' and q == 'BOOK'.
Anyway, the bookmarklet failed to correctly parse each of the two
queries on all of the five browsers.
I think the escape function is the cause.


5. Yubnub bookmarklet (encodeURIComponent)

I think the better way to parse the query in a bookmarklet is this
javascript function:
yub(s){return('http://yubnub.org/parser/parse?command='+encodeURIComponent(s).replace(/\%20/g,'+'))}
The input s is a query string such as 'naver AIR BOOK' and the output
yub(s) is the resulting yubnub url.
With this encodeURIComponent version of yubnub bookmarklet, both of the
two queries were correctly handled on all of the five browsers.

Reply all
Reply to author
Forward
0 new messages