FAQ
Cover
This is the archive Discourse for the Processing (ALPHA) software.
Please visit the new Processing forum for current information.

   Processing 1.0 _ALPHA_
   Programming Questions & Help
   Integration
(Moderators: fry, REAS)
   masked space
« Previous topic | Next topic »

Pages: 1 
   Author  Topic: masked space  (Read 1613 times)
eskimoblood

222550793222550793 WWW
masked space
« on: Mar 2nd, 2005, 3:58pm »

I have a sketch which is comunicate with a php skript. The user can send a variable by typing a string, like:
 
Code:

String  url="http://www.eskimoblood.de/test.php"+aVariable;
loadString(url);

 
It works fine, but when the user add a space to the the string, the call failed. I know there is awhy to mask the space but i dont know how.
« Last Edit: Mar 2nd, 2005, 3:59pm by eskimoblood »  
JohnG

WWW
Re: masked space
« Reply #1 on: Mar 2nd, 2005, 4:18pm »

You can change a space to either "+" or "%20"
 
fry


WWW
Re: masked space
« Reply #2 on: Mar 2nd, 2005, 5:22pm »

more broadly, you'll want to use java's URLEncoder class:
http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLEncoder.html
cuz for now it's space, but next you'll find problems with apostrophes, quotes, etc...
 
Pages: 1 

« Previous topic | Next topic »