forked from apolloconfig/apollo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apolloconfig#636 from nobodyiam/client-charset
fix default charset issue
- Loading branch information
Showing
1 changed file
with
2 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]) | ||
|
@@ -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)); | ||
} | ||
|