Merge pull request #740 from michael-o/proper-encoding

JSONTokener(InputStream) violates rfc8259#section-8.1 (#739)
This commit is contained in:
Sean Leary 2023-05-28 14:11:41 -05:00 committed by GitHub
commit 22ccf1b8e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,7 @@
package org.json;
import java.io.*;
import java.nio.charset.Charset;
/*
Public Domain.
@ -56,7 +57,7 @@ public class JSONTokener {
* @param inputStream The source.
*/
public JSONTokener(InputStream inputStream) {
this(new InputStreamReader(inputStream));
this(new InputStreamReader(inputStream, Charset.forName("UTF-8")));
}