openvidu-java-client: more UTF-8 HttpEntity fixes

pull/621/head
pabloFuente 2021-04-15 13:43:02 +02:00
parent b0d19484a7
commit 570056426c
2 changed files with 2 additions and 2 deletions

View File

@ -588,7 +588,7 @@ public class OpenVidu {
private JsonObject httpResponseToJson(HttpResponse response) throws OpenViduJavaClientException { private JsonObject httpResponseToJson(HttpResponse response) throws OpenViduJavaClientException {
try { try {
JsonObject json = new Gson().fromJson(EntityUtils.toString(response.getEntity()), JsonObject.class); JsonObject json = new Gson().fromJson(EntityUtils.toString(response.getEntity(), "UTF-8"), JsonObject.class);
return json; return json;
} catch (JsonSyntaxException | ParseException | IOException e) { } catch (JsonSyntaxException | ParseException | IOException e) {
throw new OpenViduJavaClientException(e.getMessage(), e.getCause()); throw new OpenViduJavaClientException(e.getMessage(), e.getCause());

View File

@ -689,7 +689,7 @@ public class Session {
private JsonObject httpResponseToJson(HttpResponse response) throws OpenViduJavaClientException { private JsonObject httpResponseToJson(HttpResponse response) throws OpenViduJavaClientException {
JsonObject json; JsonObject json;
try { try {
json = new Gson().fromJson(EntityUtils.toString(response.getEntity()), JsonObject.class); json = new Gson().fromJson(EntityUtils.toString(response.getEntity(), "UTF-8"), JsonObject.class);
} catch (JsonSyntaxException | IOException e) { } catch (JsonSyntaxException | IOException e) {
throw new OpenViduJavaClientException(e.getMessage(), e.getCause()); throw new OpenViduJavaClientException(e.getMessage(), e.getCause());
} }