I was just wondering, if I have an EditText that I'm turning the content of into a string, say
String queryStr = new String(searchText.getText().toString());
How would I go about escaping special characters from this string so that I could put it into an HttpGet method? Thanks!
Use java.net.URLEncoder:
java.net.URLEncoder.encode(queryStr, "UTF-8");
Try:
TextUtils.htmlEncode(queryStr);
I think that should do what you want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With