My app allows users to send a word to a search engine for more examples of usage. With help from the list I've gotten it to work with languages using the Latin alphabet, Russian, even Hindi..

It does fail, though, when I send a search string in Russian that includes any punctuation or space. For example, the search string for ой! (a two-letter word followed by an exclamation mark) shows up in the engines as http://www.google.com/search?q=%04%1E%049! .

Does anyone have suggestions on how to tweak this so terms like 'как-то' or 'потому что' can be sent to the search engines?

Existing code:

When the user displays a new term, the word to search for is set up like this:

on changeWord
global gWord, gWordToSearch

--use an invisible field so we can check its effectiveTextFont to see if it's Unicode
 set the HTMLText of fld "invisibleWordToSearch" to gWord

  set the useUnicode to true

  --if the field contains Unicode text..
if the effective textFont of word 1 of field "invisibleWordToSearch" contains comma then
    --next line works for Russian
put urlEncode(unidecode(fld "invisibleWordToSearch", utf8)) into gWordToSearch
  else
    --next line works for Roman alphabet
    put  fld "invisibleWordToSearch" into gWordToSearch
  end if

end changeWord

The 'search' button has this script:

on mouseUp
  global gWordToSearch

  revGoURL (the cSearchEngine of this stack & gWordToSearch)
end mouseUp


thanks

Curt_______________________________________________
use-revolution mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to