Commit 58bd26e3 by 张乐 Committed by GitHub

Merge pull request #636 from nobodyiam/client-charset

fix default charset issue
parents 1ca1b8d1 bd4f3115
......@@ -16,6 +16,7 @@ import com.google.common.base.Function;
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(song_s@ctrip.com)
......@@ -104,7 +105,7 @@ public class HttpUtil {
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));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment