Skip to content

Commit

Permalink
Merge pull request apolloconfig#636 from nobodyiam/client-charset
Browse files Browse the repository at this point in the history
fix default charset issue
  • Loading branch information
lepdou authored Jun 9, 2017
2 parents 1ca1b8d + bd4f311 commit 58bd26e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import com.google.common.io.BaseEncoding;
import com.google.common.io.CharStreams;
import com.google.gson.Gson;
import java.nio.charset.StandardCharsets;

/**
* @author Jason Song([email protected])
Expand Down Expand Up @@ -104,7 +105,7 @@ private <T> HttpResponse<T> doGetWithSerializeFunction(HttpRequest httpRequest,
statusCode = conn.getResponseCode();

if (statusCode == 200) {
isr = new InputStreamReader(conn.getInputStream());
isr = new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8);
String content = CharStreams.toString(isr);
return new HttpResponse<>(statusCode, serializeFunction.apply(content));
}
Expand Down

0 comments on commit 58bd26e

Please sign in to comment.