1
0
Fork 0

fixed content encoding issue when the system encoding is not utf-8

master
Bob Carroll 2014-01-17 14:43:56 -08:00
parent e6d0f04ec5
commit 0208094aa9
1 changed files with 4 additions and 1 deletions

View File

@ -125,7 +125,10 @@ public class RestClient {
StringBuilder result = new StringBuilder();
if (ent != null) {
BufferedReader br = new BufferedReader(new InputStreamReader(ent.getContent()));
InputStreamReader isr = ent.getContentEncoding() != null ?
new InputStreamReader(ent.getContent(), ent.getContentEncoding().getValue()) :
new InputStreamReader(ent.getContent());
BufferedReader br = new BufferedReader(isr);
String line = "";
while ((line = br.readLine()) != null)