Forward slashing transforming into \/ when passed through JSONObject in Android <p>I have a string that is being put into a JSONObject. It looks like this before it is passed:</p> <pre><code> Before: /storage/sdcard/Download/signature-1383757302516.jpg After: \/storage\/sdcard\/Download\/signature-1383757302516.jpg </code></pre> <p>Here is what my code looks like:</p> <pre><code> // make JSON object to hold the information, which is sent to the server JSONObject jsonObjSend = new JSONObject(); jsonObjSend.put("signature", signatureFile.getAbsolutePath()) </code></pre> <p>The output for jsonObjSend().toString() is:</p> <pre><code> \/storage\/sdcard\/Download\/signature-1383757302516.jpg </code></pre> <p>Is JSONOBject encoding the information? How do I prevent it from modifying the forward slash?</p> <p>*EDIT: I solved it using regex to remove the escape characters. </p> <pre><code> jsonObjSend.toString().replaceAll("\\\\/", "/") </code></pre>