0
I’m sending information from Android to a PHP Webservice via lib Volley.
Everything works perfectly, except with special characters.
Map<String, String> params = new HashMap<String, String>();
params.put("nome", "áàâãõóòúç");
If the name equals - nome = Maria das Graças
for example, he gives me that mistake:
Error output:
W/System.err: org.json.Jsonexception: End of input at Character 0 of
W/System.err: at org.json.JSONTokener.syntaxError(JSONTokener.java:450) > W/System.err: at org.json.JSONTokener.nextValue(JSONTokener.java:97)
W/System.err: at org.json.Jsonobject. (Jsonobject.java:155)
W/System.err: at org.json.Jsonobject.(Jsonobject.java:172) W/System.err: at Jsonobjectrequest.parseNetworkResponse(Customjsonobjectrequest.java:58)
W/System.err: at com.android.Volley.NetworkDispatcher.run(Networkdispatcher.java:125)
E/Volley: [8220] Networkdispatcher.run: Unhandled Exception
java.lang.Nullpointerexception
java.lang.Nullpointerexception at com.android.Volley.NetworkDispatcher.run(Networkdispatcher.java:130)
In PHP I had the same problem at the beginning and solved using the function utf8_encoder
.