chinese term causes a crash on web search

My app does a search for YouTube videos, but when a customer put a chinese search term in ( ??? ) it immediately crashes when hitting the search button.
The error i get is: “An exception of class Xojo.Core.InvalidArgumentException was not handled. The application must shut down.”

[code]dim s as string = textField1.text
s = s.replaceAll(" “,”+")
dim searchTerm as Text
searchTerm = s.toText

searchURL = “” + searchTerm // truncated the rest of the parameters for brevity
YTSocket1.Send(“GET”, searchURL)
// where YTSocket1 is a class

You may need to urlencode the search term.


thanks. I’ll look into that.

that worked - thanks!