0

Creating app in which my requirement is to pass encode data of string.I have Edittext and i have to encode editext text.I am doing this.

String getstr="#"+((Editext)findviewbyid(id)).getText.tostring;

String s = URLDecoder.encode(getstr, "UTF-8");

Suppose Editext text is "my data " But i am not getting proper response. I am getting

%23my%2bdata%2b

If there is space it should be %20 but why i am getting this. String should be

%23my%20data%20.

Does any one has idea.What i am doing wrong.

Mark Stewart
  • 2,024
  • 4
  • 23
  • 31
sss
  • 59
  • 7

1 Answers1

1

URLEncoder encodes HTML form data, not URL parameter data. Check the answers here.

Neel Mehta
  • 96
  • 2