Weird alphanumeric instead of space.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
panosdk
Posts: 14
Joined: Mon Jul 22, 2013 10:34 am

Weird alphanumeric instead of space.

Post by panosdk » Sat Feb 03, 2018 10:07 pm

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.

MaxV
Posts: 1547
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Weird alphanumeric instead of space.

Post by MaxV » Sat Feb 03, 2018 10:41 pm

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
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

panosdk
Posts: 14
Joined: Mon Jul 22, 2013 10:34 am

Re: Weird alphanumeric instead of space.

Post by panosdk » Sun Feb 04, 2018 9:17 pm

Thank you.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”