mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-02 19:15:27 -04:00
JSONTokener(InputStream) violates rfc8259#section-8.1 (#739)
Always use UTF-8 when an InputStream is passed. This fixes #739.
This commit is contained in:
parent
0578285036
commit
133c0cc75f
@ -1,6 +1,7 @@
|
|||||||
package org.json;
|
package org.json;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Public Domain.
|
Public Domain.
|
||||||
@ -56,7 +57,7 @@ public class JSONTokener {
|
|||||||
* @param inputStream The source.
|
* @param inputStream The source.
|
||||||
*/
|
*/
|
||||||
public JSONTokener(InputStream inputStream) {
|
public JSONTokener(InputStream inputStream) {
|
||||||
this(new InputStreamReader(inputStream));
|
this(new InputStreamReader(inputStream, Charset.forName("UTF-8")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user