Page 1 of 1

Weird alphanumeric instead of space.

Posted: Sat Feb 03, 2018 10:07 pm
by panosdk
I am trying to do a simple google search from my application. The code does this

Code: Select all

  put "https://www.google.gr/search?q=" into GQueryString 
   put the text of field "tb_query" into query
   put GqueryString & query into query
launch url query
The problem is that when my query has spaces(for example "red apple", i get a "2F850" instead of a space. This alphanumeric changes every time i run livecode. I guess it has something to do with encoding? When i print the the two strings together in a msgbox, i get the space character as expected.

Re: Weird alphanumeric instead of space.

Posted: Sat Feb 03, 2018 10:41 pm
by MaxV
Use urlencode.

Code: Select all

  put "https://www.google.gr/search?q=" into GQueryString 
   put the text of field "tb_query" into query
   put GqueryString & urlencode(query) into query
launch url query

Re: Weird alphanumeric instead of space.

Posted: Sun Feb 04, 2018 9:17 pm
by panosdk
Thank you.