Merge pull request #118 from Slarper/main
fixed potential decoding bug.
This commit is contained in:
commit
57fdcafb6f
1 changed files with 2 additions and 1 deletions
|
@ -22,6 +22,7 @@ import java.io.InputStreamReader;
|
|||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Reader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
public class JsonFactory {
|
||||
public final static Gson GSON = new GsonBuilder().setPrettyPrinting()
|
||||
|
@ -69,7 +70,7 @@ public class JsonFactory {
|
|||
Resource resource = manager.getResource(location);
|
||||
if (resource != null) {
|
||||
InputStream stream = resource.getInputStream();
|
||||
InputStreamReader reader = new InputStreamReader(stream);
|
||||
InputStreamReader reader = new InputStreamReader(stream, StandardCharsets.UTF_8);
|
||||
obj = JsonFactory.GSON.fromJson(reader, JsonObject.class);
|
||||
reader.close();
|
||||
stream.close();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue