I want send a josn string to a php sript on a webserver.
i use this code:
JSONObject json = new JSONObject();
json.put("street", "straße");
json put exactly this to the string, but the php script does not needs straße, it needs stra\u00dfe
is there any way to do this exept String.replace()
maybe this helps for a other solution, the php script deletes the ß in the string
You can’t send characters to servers, you can only send bytes. You need to figure out where your JSON string is being converted to a byte array and make sure that it includes a charset like UTF-8.
The JSON encoder won’t convert
ßto\u00dfbecause that’s not its job. As far as it is concerned,ßis a legal output character.