URLEncode Error
Posted
by
user2949519
on Stack Overflow
See other posts from Stack Overflow
or by user2949519
Published on 2013-11-03T09:43:57Z
Indexed on
2013/11/03
9:53 UTC
Read the original article
Hit count: 178
I have an Android app. Basically what it does is that user can search a car reference no. in EditText for example:- 270/30 and retrieve all the details of the particular car with the same column value in the database. I'm encoding this editext value in Android using URLEncoder and decoding it back in php webservice code. But the decoded value im getting is 027/13 ....instead of 270/30.
To make it clear more im here by pasting my java Encoding part
EditText SearchField=(EditText)findViewById(R.id.editText1);
String SearchValue= SearchField.getText().toString();
Now the encoding code in Asynctask is
data +="&" + URLEncoder.encode("data", "UTF-8") + "="+SearchValue;
Now the PHP part where i decoded this code
$data = urldecode($_POST['data']);
Please help me how to encode/decode this given format ...
Thanks in Advance
© Stack Overflow or respective owner