Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: JSON spec mandates UTF-8
  • Loading branch information
Elliotte Rusty Harold committed Jan 11, 2021
commit d1379254e88e2a3a171dd4fb05ddf28a8522901d
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import com.google.api.client.json.JsonGenerator;
import com.google.api.client.json.JsonParser;
import com.google.api.client.util.Beta;
import com.google.api.client.util.Charsets;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.InputStream;
Expand All @@ -29,6 +28,7 @@
import java.io.StringReader;
import java.io.Writer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;

/**
* Low-level JSON library implementation based on GSON.
Expand Down Expand Up @@ -60,9 +60,7 @@ static class InstanceHolder {

@Override
public JsonParser createJsonParser(InputStream in) {
// TODO(mlinder): Parser should try to detect the charset automatically when using GSON
// https://github.com/googleapis/google-http-java-client/issues/6
return createJsonParser(new InputStreamReader(in, Charsets.UTF_8));
return createJsonParser(new InputStreamReader(in, StandardCharsets.UTF_8));
}

@Override
Expand Down