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,046
  • 4
  • 22
  • 32
sss
  • 59
  • 8

1 Answers1

1

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

Neel Mehta
  • 106
  • 2